I'm looking to get a solid answer on whether it's possible to reference variables based on the value of another variable. This is possible in PHP (among others).
Example (in Sass):
I want to set the border-color to $green (or $blue, $yellow, etc), which are variables being included from a partial. I am looping through a list of color names like such:
$colors = green, yellow, blue;
@each $c in $colors {
&.#{$c} {
border-color: $#{$c};
}
}
The above code (ideally) generates classes for .green, .yellow, and .blue, each with a border-color set to $green, $yellow or $blue, respectively.
(Obviously) the above code is not working, but is there another way of achieving this in Sass/Compass?