It is impossible to make a dynamic variable in SASS at the moment, since you will add / connect another var, which you need to parse when you run the sass command.
As soon as the command starts, it throws an error for Invalid CSS, since all your declared variables will follow the climb.
After starting you cannot declare variables again on the fly
To understand that I understood this, kindly indicate whether the following is correct:
you want to declare variables where the next part (word) is dynamic
something like
$list: 100 200 300; @each $n in $list { $font-$n: normal $n 12px/1 Arial; } // should result in something like $font-100: normal 100 12px/1 Arial; $font-200: normal 200 12px/1 Arial; $font-300: normal 300 12px/1 Arial; // So that we can use it as follows when needed .span { font: $font-200; p { font: $font-100 } }
If this is what you want, I'm afraid at the moment, it's not allowed
Om Shankar Mar 05 2018-12-12T00 : 00Z
source share