Reputation: 1988
Several colors in this .scss file are defined as such:
$colors: (
primary : #cd0e11,
secondary: #23aa0b,
danger: #f53d3d,
light: #f4f4f4,
dark: #222
);
How do I access them? Say I want to set something to primary.
I tried:
h1 {
color: $colors:primary
}
This is Ionic 2, so it could be a framework specific thing.
Upvotes: 7
Views: 3308
Reputation: 98
Once you create the map, use the function map-get(). You can also loop through each one if necessary: https://webdesign.tutsplus.com/tutorials/an-introduction-to-sass-maps-usage-and-examples--cms-22184
$map: (
color01: value,
color02: nextValue,
color03: thirdValue
);
.element {
content: map-get($map, color01);
}
Upvotes: 0