Skip to content

🎨 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}
$color-options: (
a: $color-a,
b: $color-b,
c: $color-c,
);

In HTML

<div class="f--color-a">color A</div>
<div class="f--color-b">color B</div>

In SCSS

  1. Extending the generated foundation class β€” preferred method:
.c--component-a {
@extend .f--color-a;
}
  1. Using the map-get directly:
.c--component-a {
color: map-get($color-options, a);
}
Link to Codepen