Skip to main content

Colors

Colors​

Our default library Colors object is using System Colors and Design Tokens.

Design Tokens​

Design Tokens are contextual colors based on the system colors.
The design token name structure is "$[property]-[semantic]-[weight]". (e.g $backgroundPrimaryHeavy, $textSuccessLight)

Property
Token
Light Mode
Dark Mode
$backgroundDefault
$backgroundElevated
$backgroundElevatedLight
$backgroundNeutralHeavy
$backgroundNeutralIdle
$backgroundNeutralMedium
$backgroundNeutral
$backgroundNeutralLight
$backgroundPrimaryHeavy
$backgroundPrimaryMedium
$backgroundPrimaryLight
$backgroundGeneralHeavy
$backgroundGeneralMedium
$backgroundGeneralLight
$backgroundSuccessHeavy
$backgroundSuccessLight
$backgroundWarningHeavy
$backgroundWarningLight
$backgroundMajorLight
$backgroundMajorHeavy
$backgroundDangerHeavy
$backgroundDangerLight
$backgroundDisabled
$backgroundDark
$backgroundDarkElevated
$backgroundDarkActive
$backgroundInverted
  • Property - The property we use this token for. The properties are:

    • background
    • text
    • icon
    • outline
  • Semantic - the meaning of the color, what is the message that we want to pass using this color. The semantics are:

    • neutral
    • primary - the primary color of the app, means, blue for Spaces app and green for Fit app.
    • general
    • success
    • warning
    • danger
    • disabled
    • inverted
    • default
  • Weight - the weight of the color (optional). The weights are:

    • light
    • medium
    • heavy

So, for example, a valid token can be: $backgroundPrimaryHeavy or $textSuccess. A full list of our design tokens can be found here -

Dark Mode Support​

By using design tokens, your getting dark mode support out of the box! Each token is mapped to a single system color in light mode and to a (usually different) single system color in dark mode. For example, $textSuccess is mapped to green10 in light (deafult) mode, and to green60 in dark mode. All the design tokens and their mapping in light mode can be found here, dark mode mapping can be found here.

Add Your Own Design Tokens​

Adding or overriding your own design tokens can be done by using the loadSchemes method. To generate the design tokens, based on your app primary color and load them automatically into the Colors object, use:

Colors.loadDesignTokens({primaryColor: <your primary color>});

This method will update all the primary tokens to be based on your app primary color, both in light and dark mode.