Skip to main content

Colors

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

Design Tokens​

Design Tokens provide semantic meaning to our color system by mapping contextual usage to system colors. Each token follows the naming pattern: $[property][Semantic][Weight]

For example:

  • $backgroundPrimaryHeavy: A heavy primary background color
  • $textSuccess: Success-themed text color
  • $iconWarning: Warning-themed icon color

Design Token Structure​

Design tokens follow a structured naming convention: $[property][Semantic][Weight], where:

Property​

Defines the UI element the token applies to:

  • background - Background colors
  • text - Text colors
  • icon - Icon colors
  • outline - Border/outline colors

Semantic​

Represents the contextual meaning:

  • neutral - Neutral/default state
  • primary - App's primary brand color
  • general - General purpose
  • success - Positive/success states
  • warning - Warning/caution states
  • danger - Error/danger states
  • disabled - Disabled state
  • inverted - Reversed/contrasting colors
  • default - Default state

Weight (Optional)​

Indicates the color intensity:

  • light - Lighter variation
  • medium - Medium intensity
  • heavy - Heavier/darker variation

Examples:

  • $backgroundPrimaryHeavy - Dark variant of primary background
  • $textSuccess - Success state text color
  • $iconWarning - Warning state icon color

View all available design tokens in our token definition files.

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

Dark Mode Integration​

Design tokens provide seamless dark mode support through automatic color mapping. Each token maps to appropriate system colors for both light and dark themes:

// Example mapping
$textSuccess → green10 (light mode)
$textSuccess → green60 (dark mode)

View the complete token mappings:

Custom Design Tokens​

Customize the design system by:

  1. Using loadSchemes() to override existing tokens
  2. Generating tokens from your primary brand color:
Colors.loadSchemes({
light: {
$textDefault: '#20303C'
},
dark: {
$textDefault: '#F8F8F8'
}
});

This defines the default text color token for both light and dark modes.