KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a list of categories, from which I would like to set a background-color. I would like to keep the values for the background colors as variables. Is it possible to reference a variable by string interpolation? Sass is throwing an "Invalid CSS" error on me currently using this code: /* Category Colors */ $family_wellness_color: #c1d72e; $lifestyle_color: #f4eb97; $food_color: #f78f1e; ... /* Categories */ @each $cat in family_wellness, lifestyle, food { .#{$cat} { .swatch, .bar { background-color: $#{$cat}_color; } } } Possible? I would really appreciate some advice!
Tags (comma-separated)
Save Edits
Cancel