A
A
Alexander Sharomet2014-11-11 13:15:53
css
Alexander Sharomet, 2014-11-11 13:15:53

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}";
}

This example imports both files for reasons unknown to me, how can I fix this?
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladik Limonadik, 2014-11-11
@sharomet

This is impossible without a server side and generally a stupid idea. What for?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question