Closed twhoff closed 9 years ago
I've discovered the issue is related to scope.
The "for" loop is being called form within the #basic-usage node and the .-each mixin is being defined there:
@list: banana, apple, pear, potato, carrot, peach;
#basic-usage {
.for(@list); .-each(@value) {
value: @value;
}
}
So this gives us #basic-usage > .-each().
The .for() mixin then looks for the .-each() mixin but it's not in the global scope, hence it doesn't work.
I think this is a bug, as with the less compiler, this does work
It definitely looks like a bug, the .-each
mixin should be visible.
Simplified test case:
// .for-each
.for-impl_(@i) when (@i > 1) {
.-each(test);
.for-impl_((@i - 1));
}
#basic-usage {
.-each(@value) {
value: @value;
}
// it works when parameter is 2
.for-impl_(3);
}
Fixed. It will be available in next release, next week latest.
Thanks! :D
Description
Using the "for" mixins (used in more or less) doesn't seem to work. It says the mixin can't be found. However the command line less compiler has no issue.
Error:
Implementation:
Usage:
Expected output: