Skip to content

🎨 Background

The background foundation allows you to apply consistent background colors across components using a predefined map of color tokens.

It uses a loop to generate utility classes following the naming convention:

.f--background-{variation}
$colorbg-options: (
a: $color-a,
b: $color-b,
c: $color-c,
);

In HTML

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

In SCSS

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