Thrive Design System

Foundation

Colors

Our color system built using OKLCH color space for perceptually uniform colors and consistent accessibility

Overview

Our color system is built using OKLCH color space for perceptually uniform colors and consistent accessibility. The system includes comprehensive color palettes with semantic naming conventions.

Color System Overview

OKLCH Color Space

We use OKLCH (Oklch Lightness Chroma Hue) for all our color definitions because it provides:

  • Perceptual uniformity: Colors with the same lightness appear equally bright
  • Better accessibility: More predictable contrast ratios
  • Consistent saturation: Colors maintain consistent vibrancy across hues

OKLCH and Dark Mode Scaling

While OKLCH enables consistent perceptual scaling, we intentionally deviated from strict mathematical rules to ensure colors feel natural and visually harmonious. Dark mode colors are not simply inverted versions of light mode—they represent a fundamentally different approach to color presentation. We've applied distinct scaling strategies for dark mode that account for reduced ambient light, different contrast requirements, and the perceptual differences in how colors appear on dark backgrounds. This approach ensures our dark theme feels cohesive and natural, rather than mechanically inverted.

Color Palettes

Base Colors

Essential black and white colors for high contrast and foundational elements.

Base Colors

Essential black and white colors for high contrast and foundational elements.

White
Black

Primary Colors

Our primary color palette uses teal/cyan tones for the brand identity across all shades from 50 to 950.

Primary Colors

Our primary color palette uses teal/cyan tones for the brand identity across all shades from 50 to 950.

50
100
200
300
400
500
600
700
800
900
950

Gray Scale

Our neutral colors for backgrounds, borders, and subtle elements ranging from 50 to 950.

Gray Scale

Our neutral colors for backgrounds, borders, and subtle elements ranging from 50 to 950.

50
100
200
300
400
500
600
700
800
900
950

Red Palette

For errors, warnings, and destructive actions.

Red Palette

For errors, warnings, and destructive actions.

50
100
200
300
400
500
600
700
800
900

Orange Palette

Warm accent colors for highlights and notifications.

Orange Palette

Warm accent colors for highlights and notifications.

50
100
200
300
400
500
600
700
800
900

Yellow Palette

Warning states and attention-grabbing elements.

Yellow Palette

Warning states and attention-grabbing elements.

50
100
200
300
400
500
600
700
800
900

Green Palette

Success states, positive feedback, and nature themes.

Green Palette

Success states, positive feedback, and nature themes.

50
100
200
300
400
500
600
700
800
900

Teal Palette

Cool accent colors and secondary brand elements.

Teal Palette

Cool accent colors and secondary brand elements.

50
100
200
300
400
500
600
700
800
900

Blue Palette

Information states, links, and professional themes.

Blue Palette

Information states, links, and professional themes.

50
100
200
300
400
500
600
700
800
900

Indigo Palette

Deep blue tones for sophisticated interfaces.

Indigo Palette

Deep blue tones for sophisticated interfaces.

50
100
200
300
400
500
600
700
800
900

Purple Palette

Creative and premium brand elements.

Purple Palette

Creative and premium brand elements.

50
100
200
300
400
500
600
700
800
900

Pink Palette

Playful accents and feminine brand elements.

Pink Palette

Playful accents and feminine brand elements.

50
100
200
300
400
500
600
700
800
900

Semantic Color Tokens

These are the key semantic colors used throughout the design system, organized by purpose and usage:

Background Semantic Colors

Background Colors

Use semantic background colors to ensure consistent theming across light and dark modes.

  • Panel (--color-panel): Card/panel backgrounds
  • Background (--color-bg): Main page background
  • Secondary (--color-secondary): Secondary backgrounds
  • Muted (--color-muted): Subtle backgrounds
  • Primary Muted (--color-primary-muted): Light primary backgrounds

Action & State Colors (Solid)

  • Primary Solid (--color-primary-solid): Primary buttons & actions
  • Success Solid (--color-success-solid): Success states & confirmations
  • Warning Solid (--color-warning-solid): Warning states & cautions
  • Destructive Solid (--color-destructive-solid): Destructive actions & errors
  • Info Solid (--color-info-solid): Information & notifications

Text Colors (Ink)

  • Ink Dark (--color-ink-dark): Primary headings & emphasis
  • Ink (--color-ink): Body text & default content
  • Ink Light (--color-ink-light): Secondary text & metadata
  • Ink Muted (--color-ink-muted): Placeholder & disabled text

Semantic Text Colors

Specialized text colors for different states:

  • Primary, Success, Warning, Destructive, Info
  • Teal, Purple, Indigo, Orange, Pink

Border Colors

  • Default (--color-border): Standard borders
  • Input (--color-border-input): Form input borders
  • Hover (--color-border-hover): Hover state borders
  • Focus (--color-border-focus): Focus state borders
  • And semantic variants (Primary, Success, Warning, Destructive, etc.)

Icon Colors

  • Default Icon (--color-icon): Standard icon color
  • Light Icon (--color-icon-light): Subtle icon color
  • Primary Icon (--color-icon-primary): Primary brand icons
  • Destructive Icon (--color-icon-destructive): Error/warning icons

Dark Mode Support

Automatic Dark Mode

All colors automatically adapt to dark mode using CSS custom properties. The dark mode theme inverts and adjusts colors for optimal readability in low-light conditions.

Key Dark Mode Changes

.dark {
  /* Backgrounds become dark */
  --color-panel: oklch(0.21 0.02 256);     /* Dark panels */
  --color-bg: var(--color-gray-50);        /* Very dark background */
  
  /* Text becomes light */
  --color-ink-dark: oklch(0.98 0 0);       /* White text */
  --color-ink: oklch(0.95 0 248);          /* Light text */
  --color-ink-light: oklch(0.71 0.02 259); /* Muted light text */
  --color-ink-muted: oklch(0.6 0.05 258);  /* Dark mode muted */
  
  /* Primary colors adjust for better contrast */
  --color-primary-solid: var(--color-primary-400);
  --color-primary-solid-hover: var(--color-primary-600);
  
  /* Semantic colors use lighter variants */
  --color-ink-destructive: var(--color-red-900);
  --color-ink-success: var(--color-green-900);
  --color-ink-warning: var(--color-yellow-900);
}

Testing Dark Mode

To test dark mode functionality:

  1. In Storybook: Use the theme toggle in the toolbar
  2. In your app: Add class="dark" to the <html> or <body> element
  3. URL parameter: Add ?theme=dark to test specific scenarios

Dark Mode Setup

If dark mode is not working in Storybook, ensure the globals.css file is properly imported and the .dark class is being applied to the document root.

Best Practices

Use semantic color tokens

Always use semantic color tokens (like --color-primary-solid) instead of raw color values for consistent theming across light and dark modes.

Test color combinations

Test all color combinations for accessibility compliance. Ensure proper contrast ratios for text and interactive elements.

Use OKLCH values

Use the OKLCH values provided in design tokens for consistent color perception across all hues.

Don't use hard-coded colors

Don't use hard-coded hex colors in components. Always reference design tokens for maintainability.

Don't create custom colors

Don't create custom colors outside the design system without consulting the design team.

Don't ignore contrast requirements

Don't use colors that don't meet WCAG 2.1 AA contrast requirements (4.5:1 for normal text, 3:1 for large text).

Accessibility

WCAG Compliance

All color combinations meet WCAG 2.1 AA standards for accessibility.

All color combinations meet WCAG 2.1 AA standards:

  • Normal text: 4.5:1 contrast ratio minimum
  • Large text: 3:1 contrast ratio minimum
  • Interactive elements: Clear focus indicators
  • Color-blind friendly: Not relying on color alone to convey meaning

Implementation

CSS Custom Properties

.my-component {
  background-color: var(--color-panel);
  color: var(--color-ink);
  border: 1px solid var(--color-border);
}

Tailwind Classes

<div class="bg-panel text-ink border border-border">
  Content with semantic colors
</div>

React Component

<Card className="bg-panel text-ink border-border">
  <Text color="text-ink-light">Secondary text</Text>
</Card>