I am working with a map of colors in SASS that looks like this:
$form-option-colors: (
1: rgba(242,218,177,1),
2: rgba(222,186,133,1),
3: rgba(255,139,107,1),
4: rgba(237,116,83,1),
5: rgba(245,98,140,1),
6: rgba(148,61,112,1),
7: rgba(49,127,163,1),
8: rgba(39,101,130,1)
);
My goal is to assign each of these colors to a different div. I attempted to use a @for loop in SASS for this task but encountered Compilation Errors. Here's the code snippet I used for the @for loop:
@for $i from 1 through 8 {
$color: map.get($form-option-colors, $i);
.option-#{$i} {
color: $color;
}
}
I have 8 distinct .option containers that I am iterating through. How can I resolve this issue and make it work seamlessly?