π¨ Color
The color foundation allows you to apply consistent colors across components using a predefined map of color tokens.
It uses a loop to generate utility classes following the naming convention:
.f--color-{variation}
π This loop will iterate over a map like this:
Section titled βπ This loop will iterate over a map like this:β$color-options: ( a: $color-a, b: $color-b, c: $color-c,);
π§ How to use it
Section titled βπ§ How to use itβIn HTML
<div class="f--color-a">color A</div><div class="f--color-b">color B</div>
In SCSS
- Extending the generated foundation class β preferred method:
.c--component-a { @extend .f--color-a;}
- Using the map-get directly:
.c--component-a { color: map-get($color-options, a);}