Site Colors

Colors

Usage

Colours can be referenced with the Sass function color():

.foobar {
    background: color(primary);
}

Loops

You may need to loop through each of the theme colors to generate specifically themed components. This should be used sparingly as it will bloat the CSS. Instead try and rely on the helper classes.

@each $name, $color in $colors {
    .foobar--#{$name} {
        background: $color;
    }
}
<div class="color-box-group">
    <div class="color-box color-box--primary">
        <div class="color-box__color"></div>
        <div class="color-box__context">
            <div class="color-box__color-code">primary</div>
            <div class="color-box__color-name">#1F4A7F</div>
        </div>
    </div>
    <div class="color-box color-box--secondary">
        <div class="color-box__color"></div>
        <div class="color-box__context">
            <div class="color-box__color-code">secondary</div>
            <div class="color-box__color-name">#FE9D2E</div>
        </div>
    </div>
    <div class="color-box color-box--grey-xdark">
        <div class="color-box__color"></div>
        <div class="color-box__context">
            <div class="color-box__color-code">grey-xdark</div>
            <div class="color-box__color-name">#111111</div>
        </div>
    </div>
    <div class="color-box color-box--grey-dark">
        <div class="color-box__color"></div>
        <div class="color-box__context">
            <div class="color-box__color-code">grey-dark</div>
            <div class="color-box__color-name">#333333</div>
        </div>
    </div>
    <div class="color-box color-box--grey-base">
        <div class="color-box__color"></div>
        <div class="color-box__context">
            <div class="color-box__color-code">grey-base</div>
            <div class="color-box__color-name">#999999</div>
        </div>
    </div>
    <div class="color-box color-box--grey-mid">
        <div class="color-box__color"></div>
        <div class="color-box__context">
            <div class="color-box__color-code">grey-mid</div>
            <div class="color-box__color-name">#cccccc</div>
        </div>
    </div>
    <div class="color-box color-box--grey-light">
        <div class="color-box__color"></div>
        <div class="color-box__context">
            <div class="color-box__color-code">grey-light</div>
            <div class="color-box__color-name">#e6e6e6</div>
        </div>
    </div>
    <div class="color-box color-box--grey-xlight">
        <div class="color-box__color"></div>
        <div class="color-box__context">
            <div class="color-box__color-code">grey-xlight</div>
            <div class="color-box__color-name">#f9fafa</div>
        </div>
    </div>
</div>
{
  "colors": [
    {
      "name": "primary",
      "hex": "#1F4A7F"
    },
    {
      "name": "secondary",
      "hex": "#FE9D2E"
    },
    {
      "name": "grey-xdark",
      "hex": "#111111"
    },
    {
      "name": "grey-dark",
      "hex": "#333333"
    },
    {
      "name": "grey-base",
      "hex": "#999999"
    },
    {
      "name": "grey-mid",
      "hex": "#cccccc"
    },
    {
      "name": "grey-light",
      "hex": "#e6e6e6"
    },
    {
      "name": "grey-xlight",
      "hex": "#f9fafa"
    }
  ]
}