Reputation:
I have this map
$colors: (
black: $black,
blue1: $blue1,
blue2: $blue2,
blue3: $blue3,
blue4: $blue4,
blue5: $blue5,
blue6: $blue6,
coral1: $coral1,
coral2: $coral2,
coral3: $coral3,
coral4: $coral4,
coral5: $coral5,
green1: $green1,
green2: $green2,
green3: $green3,
grey1: $grey1,
grey2: $grey2,
grey3: $grey3,
grey4: $grey4,
grey5: $grey5,
grey6: $grey6,
orange1: $orange1,
orange2: $orange2,
red1: $red1,
red2: $red2,
red3: $red3,
saffron2: $saffron2,
transparent: $transparent,
white: $white,
);
And I want to export every key of it, like:
:export {
@each $name, $color in $colors {
name: $name
}
}
What I get after importing it is an object with only the last key of the map, why is that? I want the object to be filled with every key
Upvotes: 1
Views: 675
Reputation:
Don't ask me why but apparently putting the key in an interpolation made it to work as intented
:export {
@each $name, $color in $colors {
#{$name}: $name
}
}
Now I get the full object
Upvotes: 2