How to generate dynamic variables in SASS?
I have array/list with colors:
$colors: (
1: 'black',
2: 'red',
3: 'yellow'
);
And now, I also generate dynamic classes:
@each $i, $color in $colors {
.bg-color-#{$i} {
background-color: $color;
}
.text-color-#{$i} {
color: $i;
}
}
Now, I would like have just variables, like this:
$color-1: 'black';
$color-2: 'red';
// etc.
And in future using like this:
.some-class {
color: $color-2;
}
So, my loop should be generate dynamic variables based on array/list.