The following LESS code fails to compile, despite the fact that @color is correctly resolved to #3AD49E. (Thanks to Defining Variable Variables using LESS CSS .)
@success-color: #3AD49E;
@darken-percent: 5%;
.make-colored-div(@name) {
@color: ~'@{@{name}-color}';
&.@{name} {
background: @color;
border-color: darken(@color, @darken-percent);
}
}
button {
.make-colored-div(success);
}
Any ideas how to get darken to work?
@colorin HSL space, before applying itdarkenfunction. You should write this:@color1: hsl(hue(@color), saturation(@color), lightness(@color));but strangley it does not run for generated@colorvariable. If you replace it with original@succes-colorone, it runs correctly. I don't know if its a bug or a limitation - Luca Detomi