Less multiple files import

后端 未结 1 739
南笙
南笙 2020-12-19 21:51

I\'m working on WordPress theme that needs to have color schemes functionality. I am forced to use less on this project. I have file called schemes.less, that contains code

相关标签:
1条回答
  • 2020-12-19 22:26

    Isolate themes from each other with "unnamed" namespaces:

    & {
        @import (multiple) "schemes.less"
        @import "dark.less";
    }
    
    & {
        @import (multiple) "schemes.less"
        @import "light.less";
    }
    
    // etc.
    

    (Assuming you're using an up-to-date Less compiler, not lessphp - for that one you need minor modifications - e.g. remove (multiple) etc.).

    0 讨论(0)
提交回复
热议问题