Answer the question
In order to leave comments, you need to log in
Why doesn't this "script" on less run?
I have a 10x10 matrix. I want to select a triangle (from squares) on the side in it, occupying almost half of the "matrix" block.
My algorithm is this:
@tens: 2;
@ones: 1;
@reones: 8;
@num: @tens * 10 + @ones;
.mixin2(@tens, @reones) when (@tens =< 9) {
.mixin(@num) when (@num =< ~"[email protected]{reones}") {
.square:nth-child(@{num}) {
animation: none;
background-color: black;
}
.mixin(@num: @num + 1);
}
.mixin2(@tens: @tens + 1, @reones: @reones - 1);
}
.mixin2(@tens, @reones);
Answer the question
In order to leave comments, you need to log in
Exactly! Exactly! I specified a mixin within a mixin, but forgot to call it!
.diag(@i: 0) when(@i < 100)
{
@x: mod(@i, 10);
@y: floor(@i / 10);
@squareI: @i + 1;
.square:nth-child(@{squareI}) when(@x < @y)
{
background: black;
}
.diag(@i + 1);
}
.diag();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question