Skip to content


The If color palette reflects the tonality of the brand: uncomplicated, warm and personal. It fulfills specific functions and manages content effectively.

$ npm i @if-design-system/color@13.10.5

Accessibility in typography

For every background color, we have found a corresponding AA compliant text color as the default text color. We use a ratio threshold of 5. We recommend this tool to check your color contrasts:

Below is the Stylus mixin we use to generate AA compliant text colors while generating background color classes.

$color-text-wcag-ratio = 5

  if(contrast($color, $color-text-lightest-beige).ratio > $color-text-wcag-ratio){
    color $color-text-lightest-beige
  } else if(contrast($color, $color-text-brown).ratio > $color-text-wcag-ratio){
    color $color-text-brown
  } else {
    color $color-text-lightest-beige

And here is how we do it with a SCSS/SASS mixin:

@import 'sass-color-helpers/stylesheets/_color-helpers.scss';

$color-text-wcag-ratio: 5;

@mixin IDS_COLOR_GetCorrectContrastColor($backgroundColor) {
  $contrast1: ch-color-contrast($backgroundColor, $color-text-lightest-beige);
  $contrast2: ch-color-contrast($backgroundColor, $color-text-brown);

  @if $contrast1 > $color-text-wcag-ratio {
    color: $color-text-lightest-beige;
  } @else if $contrast2 > $color-text-wcag-ratio {
    color: $color-text-brown;
  } @else {
    color: $color-text-lightest-beige;


@color-text-wcag-ratio: 5;

.ch-color-luminance-raw(@rgb) {
  @result: if((@rgb < 0.03928), @rgb / 12.92, pow((@rgb + 0.055) / 1.055, 2.4, 16));

.ch-color-luminance(@color) {
  @red: red(@color) / 255;
  @green: green(@color) / 255;
  @blue: blue(@color) / 255;

  @rgba-lum-raw-red: .ch-color-luminance-raw(@red) [ @result];
  @rgba-lum-raw-green: .ch-color-luminance-raw(@green) [ @result];
  @rgba-lum-raw-blue: .ch-color-luminance-raw(@blue) [ @result];

  @result: 0.2126 * @rgba-lum-raw-red + 0.7152 * @rgba-lum-raw-green + 0.0722 * @rgba-lum-raw-blue;

.ch-color-contrast(@color1, @color2) {
  @luminance1: .ch-color-luminance(@color1) [ @result] + 0.05;
  @luminance2: .ch-color-luminance(@color2) [ @result] + 0.05;
  @ratio1: @luminance1 / @luminance2;
  @ratio: if((@luminance2 > @luminance1), 1 / @ratio1, @ratio1);

  @result: round(@ratio * 10) / 10;

.IDS_COLOR_GetCorrectContrastColor(@backgroundColor) {
  @contrast1: .ch-color-contrast(@backgroundColor, @color-text-lightest-beige) [ @result];
  @contrast2: .ch-color-contrast(@backgroundColor, @color-text-brown) [ @result];

  .contrastColor() when (@contrast1 > @color-text-wcag-ratio) {
    color: @color-text-lightest-beige;

  .contrastColor() when (@contrast2 > @color-text-wcag-ratio) {
    color: @color-text-brown;

  .contrastColor() when (default()) {
    color: @color-text-lightest-beige;

Edit this section


All of the tokens can be used as preprocessor variables


Name Hex Rgb Example
#97e2f7 rgb(151, 226, 247)
#4cb0d3 rgb(76, 176, 211)
#5392b2 rgb(83, 146, 178)
#0054f0 rgb(0,84,240)
#004080 rgb(0, 64, 128)
#f09c00 rgb(240, 156, 0)
#faf9f7 rgb(250,249,247)
#f6f3f0 rgb(246,243,240)
#f1ece8 rgb(241,236,232)
#ede6e1 rgb(237,230,225)
#e8e0d9 rgb(232,224,217)
#ffc9a6 rgb(255, 201, 166)
#ff8569 rgb(255, 133, 105)
#805c5c rgb(128, 92, 92)
#217331 rgb(33, 115, 49)
#bb320c rgb(187, 50, 12)
#6e625e rgb(110,98,94)
#331e11 rgb(51,30,17)
#b5ede8 rgb(181, 237, 232)
#87c7ba rgb(135, 199, 186)
#6b9994 rgb(107, 153, 148)
#ffe082 rgb(255, 224, 130)
#fcc74f rgb(252, 199, 79)
#b08759 rgb(176, 135, 89)


Name Value Example


Name Value Example


Name Value Example


Name Value Example


Name Value Example


Name Value Example


Name Value Example


Name Value Example
Edit this section


Here you will see the full reference of exposed classnames to be utilised as helper classes for your html styling.


These are not class helpers to be used freely. Follow our design guidelines on how to use the colors correctly.

Background-color class helpers Example
class="if color accent blue"
class="if color interaction dark-blue"
class="if color background dark-beige"
class="if color background beige"
class="if color background light-beige"
class="if color background lighter-beige"
class="if color background lightest-beige"
class="if color text lightest-beige"
class="if color text brown"
class="if color text light-brown"
class="if color infographic dark-red"
class="if color infographic red"
class="if color infographic light-red"
class="if color infographic dark-yellow"
class="if color infographic yellow"
class="if color infographic light-yellow"
class="if color infographic dark-green"
class="if color infographic green"
class="if color infographic light-green"
class="if color infographic dark-blue"
class="if color infographic blue"
class="if color infographic light-blue"
class="if color status green"
class="if color status red"
Edit this section

App development

For application development, we also expose tokens for native app development, like Android and IOS. We also expose tokens for JavaScript development.


We expose this file: @if-design-system/color/src/variables/js/variables.esm.js, in this format:

module.exports = {
  "color": {"background": {
      "lightest-beige": {
        "value": "#faf9f7",
        "filePath": "./src/tokens/background.json",
        "isSource": true,
        "original": {
          "value": "{color.base.beige.100.value}"
        "name": "ColorBackgroundLightestBeige",
        "attributes": {
          "category": "color",
          "type": "background",
          "item": "lightest-beige"
        "path": [

This can be used like so:

import colors from '@if-design-system/color/src/variables/js/variables.module.js';

const myTitle = ({title}) => (<h1 style={{color: color.text.brown.value}})>{title}</h1>);

And we also expose this file: @if-design-system/color/src/variables/js/variables.esm.js, in this format:

export const ColorBaseGreen100 = "#217331";
export const ColorBaseRed100 = "#bb320c";
export const ColorBaseBrown100 = "#6e625e";
export const ColorBaseBrown200 = "#331e11";
export const ColorBaseTeal100 = "#b5ede8";

This can be used like so:

import { ColorTextBrown } from '@if-design-system/color/src/variables/js/variables.esm.js';

const myTitle = ({title}) => (<h1 style={{color: ColorTextBrown}})>{title}</h1>);


For Android development, you might be interested in this file: @if-design-system/color/src/variables/android/colors.xml, in this format:

<?xml version="1.0" encoding="UTF-8"?>
  <color name="color_background_lightest_beige">#fffaf9f7</color>
  <color name="color_background_lighter_beige">#fff6f3f0</color>
  <color name="color_background_light_beige">#fff1ece8</color>
  <color name="color_background_beige">#ffede6e1</color>
  <color name="color_background_dark_beige">#ffe8e0d9</color>
  <!-- ... -->


For IOS development, we have IfDesignSystemColor.h and IfDesignSystemColor.m under src/variables/ios, and IfDesignSystem.swift and IfDesignSystemColor.swift under src/variables/ios-swift.


We also have ifdesignsystem.dart under src/variables/flutter.

Edit this section

Contact us