lesserphp
lesserphp copied to clipboard
Recursive Mixins broken
Hey,
thank you for maintaining lesserphp :-)
However, there seems to be a regression: Recursive mixins are now broken.
An example that works in the original leafo/lessphp, but is broken in this repository:
div {
.loop-grid-columns(4, class, width);
}
@grid-columns: 12;
.loop-grid-columns(@index, @class, @type) when (@index >= 0) {
.calc-grid-column(@index, @class, @type);
// next iteration
.loop-grid-columns((@index - 1), @class, @type);
}
.calc-grid-column(@index, @class, @type) when (@type = width) and (@index > 0) {
.col-@{class}-@{index} {
width: percentage((@index / @grid-columns));
}
}
expected outcome (see it at less2css.org):
div .col-class-4 {
width: 33.33333333%;
}
div .col-class-3 {
width: 25%;
}
div .col-class-2 {
width: 16.66666667%;
}
div .col-class-1 {
width: 8.33333333%;
}
However the repo MarcusSchwarz/lesserphp gives me the error .calc-grid-column is undefined: failed at
.calc-grid-column(@index, @class, @type); in mixins.less at line 9