@color-purple: "#ffffff"
@colors: purple, light-purple, green, light-green, red, light-red, grey, light-grey, lightest-grey;
.ColorsMixin(@i:0) when(@i =< length(@colors)){ //loop over icons array
@color: extract(@colors, @i); //extract the icon at current index @i
.color--@{color}{
background: @{color-@{color}};
&:before{
content: "@{color}";
}
&:after{
content: "\@{color-@{color}}";
}
}
.ColorsMixin(@i + 1);
}
.ColorsMixin();
In order to achieve the desired outcome for the
content: "\@{color-@{color}}";
section, I have successfully generated:
content: "#ffffff";
However, encountering an issue when attempting to output the @color-purple variable as the background. LESS triggers an error in this case. It appears to function only with quotation marks enclosing it, yet the background property necessitates the hex code without quotes.
Is there a specific method to overcome this challenge?