I have the following array of color definitions:
@colors: ~"black" #000, ~"white" #fff, ~"blue" #008FD6, ~"bluehover" #44A1E0, ~"grayborder" #DBDBDB;
And I use the following function to use those colors within CSS declarations.
.colorkey(@key) {
.-(length(@colors));
.-(@i) when (@i > 0) {.-((@i - 1))}
.-(@i) when (@key = extract(extract(@colors, @i), 1)) {
@colorkey: extract(extract(@colors, @i), 2);
}
.--() {@colorkey: #000} .--;
}
Usage:
.my-div {
.colorkey(~"black");
color: @colorkey
}
However I'd prefer to use the mixin like so:
.colorkey(black);
Without the quotes and tilde. Is it possible to modify the colorkey mixin to achieve this?