Answer the question
In order to leave comments, you need to log in
Less how to import a file with a when condition?
Hello.
Question
How can I import a file in less by condition - that is, if the variable is 0, we import one file, if it is greater than zero, then another, etc.
@template-productlist-id=1;
& when (@template-productlist-id=0) {
import "product-lists/product-list0";
}
& when (@template-productlist-id>0) {
import "product-lists/[email protected]{template-productlist-id}";
}
Answer the question
In order to leave comments, you need to log in
This is impossible without a server side and generally a stupid idea. What for?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question