I'm trying to cleanup some of my styles for a Rails 4.1 app. Instead of listing out every color and it's variations, I would like to create a mapping of colors/values and then generate the CSS by iterating over it.
# colors.css.scss
$colors: (
"red": #330000,
"blue": #003300
);
However, I get the following error from this:
Invalid CSS after "$colors: (red": expected ")", was ": #330000, blue..."
I can use Sass variables and mixins just fine; why can't I use SASS mappings as well?
As @dinocarl kindly pointed out, the
map
andlist
features of SASS are in version 3+. I had to upgradesass-rails
gem to version 5+ because that version of the gem packages SASS 3+. Worked like a charm after I upgraded the gem version (also were few additional dependencies I had to update).