Less CSS compilation order

I have several multiple LESS files that I want to compile using the WinLess compiler.

Now some of these files have dependencies of / mixins variables defined in a separate smaller file.

My question is, can I select all of them at once and compile with WinLess OR, there should be a compilation sequence.

I am looking through this question as I get a NameError (e.g. undefined transition) when compiling files that reference mixins..and, even if I compile var / mixin files first, I still get NameError

Please, help.

+4
source share
1 answer

You say that you have dependencies in separate files. This means that they must be @import ed, and not compiled separately.
For instance:

 @import "variables.less"; @import "mixins.less"; body { .my-mixin(@color); } 

Such code should contain only one file, since variables and mixins should not generate code.

+4
source

Source: https://habr.com/ru/post/1496772/


All Articles