I have this less code :
colors : 1 #F00, 2 #0F0, 3 #00F, 4 #F0F;
.for(@colors); .-each(@values) {
@position: extract(@values, 1);
@color: extract(@values, 2);
&.raster-@{position} {
background-image: linear-gradient(#000000, @color);
}
}
I am using the for mixin from https://github.com/seven-phases-max/less.curious/blob/master/src/for.less
The generated code is :
.bg-1 {
background-color: #ff0000 !important;
color: extract(1 #ff0000, 3);
}
.bg-2 {
background-color: #00ff00 !important;
color: extract(2 #00ff00, 3);
}
.bg-3 {
background-color: #0000ff !important;
color: extract(3 #0000ff, 3);
}
.bg-4 {
background-color: #ff00ff !important;
color: extract(4 #ff00ff, 3);
}
I found the problem. I use .for() to generate .bg-xx classes.
@bgColors : red red yellow, blue blue white;
.for(@bgColors); .-each(@values) {
@name: extract(@values, 1);
@bgColor: extract(@values, 2);
@color: extract(@values, 3);
&.bg-@{name} {
background-color: @bgColor !important;
color: @color;
}
}
Whats wrong with this code ?