Color Tokens

OKLCH color scales and semantic color tokens

Seed Hues

Override these variables to regenerate entire color palettes:

:root {
  --shift-hue-primary: 250;    /* Blue (default) */
  --shift-hue-secondary: 180;  /* Cyan */
  --shift-hue-accent: 30;      /* Orange */
  --shift-hue-success: 145;    /* Green */
  --shift-hue-warning: 45;     /* Amber */
  --shift-hue-danger: 25;      /* Red */
  --shift-hue-neutral: 250;    /* Blue-tinted grays */
}

Color Scales

Each color has an 11-step scale (50-950):

Primary Colors

TokenLightnessUsage
--s-primary-500.978Lightest backgrounds
--s-primary-1000.936Hover backgrounds
--s-primary-2000.881Subtle borders
--s-primary-3000.827Disabled states
--s-primary-4000.742Secondary elements
--s-primary-5000.648Primary interactive
--s-primary-6000.573Hover states
--s-primary-7000.469Active states
--s-primary-8000.394High contrast
--s-primary-9000.320Near black
--s-primary-9500.238Darkest

Using Color Tokens

.my-element {
  background: var(--s-primary-100);
  color: var(--s-primary-900);
  border-color: var(--s-primary-300);
}
<div style="background: var(--s-accent-500);">
  Accent background
</div>

Semantic Color Tokens

Semantic tokens map to raw colors and adapt to light/dark mode:

Surface Colors

TokenLight ModeDark ModeUsage
--s-surface-baseneutral-50neutral-950Default backgrounds
--s-surface-raisedneutral-100neutral-900Cards, modals
--s-surface-sunkenneutral-200neutral-800Inputs, wells

Text Colors

TokenLight ModeDark ModeUsage
--s-text-primaryneutral-900neutral-50Main text
--s-text-secondaryneutral-600neutral-400Muted text
--s-text-disabledneutral-400neutral-600Disabled text

Border Colors

TokenLight ModeDark ModeUsage
--s-border-defaultneutral-200neutral-800Default borders
--s-border-strongneutral-400neutral-600Emphasized borders
--s-focus-ringprimary-500primary-400Focus rings

Interactive Colors

TokenLight ModeDark ModeUsage
--s-interactive-primaryprimary-600primary-400Buttons, links
--s-interactive-hoverprimary-700primary-300Hover states
--s-interactive-activeprimary-800primary-200Active states

Status Colors

Success

--s-success-500: oklch(0.648 0.147 145);

Warning

--s-warning-500: oklch(0.648 0.147 45);

Danger

--s-danger-500: oklch(0.648 0.147 25);

Brand-Tinted Neutrals

The --shift-hue-neutral variable adds a subtle tint to all gray colors:

/* Default: Blue-tinted grays */
--shift-hue-neutral: 250;

/* Warm grays */
--shift-hue-neutral: 30;

/* Cool grays */
--shift-hue-neutral: 210;

/* Match your primary color */
--shift-hue-neutral: var(--shift-hue-primary);

Customizing Colors

Change Brand Colors

:root {
  --shift-hue-primary: 280;    /* Purple */
  --shift-hue-neutral: 280;    /* Purple-tinted grays */
}

Override Specific Steps

:root {
  /* Make primary-500 more saturated */
  --s-primary-500: oklch(0.65 0.2 var(--shift-hue-primary));
}

Custom Semantic Mappings

:root {
  --s-interactive-primary: var(--s-primary-700);
  --s-surface-base: var(--s-neutral-100);
}

OKLCH Color Format

All colors use the OKLCH color space:

oklch(L C H)
/* L = Lightness (0-1) */
/* C = Chroma (0-0.4) */
/* H = Hue (0-360) */

This ensures perceptually uniform colors across all hues.

Search