Thrive Design System

Foundation

Tokens

Semantic color tokens and CSS custom properties for consistent theming

Semantic Naming

Use semantic tokens (like --color-primary-solid) instead of raw color values. This ensures consistency and enables automatic theme switching.

Background Colors (Surface)

Background colors for the design system

Panel
Background
Secondary
Muted
Solid

Primary Background Tokens

Primary brand colors for backgrounds

Primary Muted
Primary Solid
Primary Hover
Bright Primary
Primary Contrast

Semantic Action Colors

Solid State Colors

Semantic action colors for buttons and states

Primary
Success
Warning
Destructive
Destructive Hover
Info

Text Colors (Ink)

Primary Text Hierarchy

Text colors organized by importance and hierarchy

Dark
Default
Light
Muted

Semantic Text Colors

Semantic text colors for different states and purposes

Primary
Primary Contrast
Success
Warning
Destructive
Info
Teal
Purple
Indigo
Orange
Pink
White

Border Colors

Base Border Tokens

Standard border colors for default states

Default
Input
Hover
Secondary
Muted
Focus

Semantic Border Colors

Semantic border colors for different states

Primary
Success
Warning
Destructive
Info
Teal
Purple
Indigo
Orange
Pink

Icon Colors

Semantic icon colors for different purposes

Default
Light
Primary
Primary Bright
Destructive
{
--sidebar: var(--color-bg);                         /* Sidebar background */
--sidebar-foreground: var(--color-ink);             /* Sidebar text */
--sidebar-primary: var(--color-ink-dark);           /* Sidebar primary */
--sidebar-primary-foreground: var(--color-bg);      /* Sidebar primary text */
--sidebar-accent: var(--color-secondary);           /* Sidebar accent */
--sidebar-accent-foreground: var(--color-ink-dark); /* Sidebar accent text */
--sidebar-border: var(--color-border);              /* Sidebar borders */
--sidebar-ring: var(--color-gray-500);              /* Sidebar focus ring */
}

Spacing Tokens

Spacing tokens provide consistent spacing throughout the design system. All spacing values are in pixels.

Spacing Tokens

Consistent spacing values for margins, padding, and gaps

space-0
0px
space-4xs
1px
space-3xs
2px
space-2xs
4px
space-xs
8px
space-sm
12px
space-md
16px
space-lg
20px
space-xl
24px
space-2xl
32px
space-supra-1
40px
space-supra-2
48px
space-supra-3
64px
space-supra-4
80px
space-ultra-1
96px
space-ultra-2
128px
space-ultra-3
256px

Dark Mode Tokens

All tokens automatically adapt to dark mode. Key differences:

.dark {
  /* Backgrounds */
  --color-panel: oklch(0.21 0.02 256);     /* Dark panels */
  --color-bg: var(--color-gray-950);       /* Very dark background */
  
  /* Text */
  --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 */
  --color-ink-muted: oklch(0.6 0.05 258);  /* Dark muted */
  
  /* Primary colors */
  --color-primary-solid: var(--color-primary-400);
  --color-primary-solid-hover: var(--color-primary-600);
  
  /* Semantic colors */
  --color-ink-destructive: var(--color-red-400);
  --color-ink-success: var(--color-green-400);
  --color-ink-warning: var(--color-yellow-400);
}

Usage Examples

CSS

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

.my-component:hover {
  border-color: var(--color-border-hover);
}

.my-component:focus {
  border-color: var(--color-border-focus);
  outline: 2px solid var(--color-primary-solid);
}

Tailwind CSS

<div class="bg-panel text-ink border border-border">
  <h2 class="text-ink-dark font-semibold">Heading</h2>
  <p class="text-ink-light">Secondary text</p>
</div>

React Component

<Card className="bg-panel border-border">
  <CardHeader>
    <CardTitle className="text-ink-dark">Title</CardTitle>
    <CardDescription className="text-ink-light">Description</CardDescription>
  </CardHeader>
  <CardContent className="text-ink">
    Content with semantic colors
  </CardContent>
</Card>

Spacing Usage

/* Using CSS custom properties */
.my-component {
  padding: var(--spacing-space-md);
  margin-bottom: var(--spacing-space-lg);
  gap: var(--spacing-space-sm);
}
// Using Tailwind classes (when configured)
<div className="p-md mb-lg gap-sm">
  Content with spacing tokens
</div>
// In React components with inline styles
<div style={{ 
  padding: 'var(--spacing-space-md)',
  marginBottom: 'var(--spacing-space-xl)'
}}>
  Content
</div>

Best Practices

Always use tokens

Use semantic color tokens instead of hard-coded values. This ensures consistency and theme compatibility.

Test in both themes

Always test your components in both light and dark modes to ensure proper contrast and readability.

Use semantic meanings

Choose tokens based on semantic meaning (e.g., --color-destructive-solid for delete buttons).

Don't create custom tokens

Don't create new color tokens without consulting the design team. Use existing tokens.

Don't use raw color values

Avoid using hex, RGB, or HSL values directly. Always reference design tokens.

Don't override token values

Don't override token values in your components. If a token doesn't work, discuss with the design team.

Accessibility

Contrast Requirements

All color token combinations meet WCAG 2.1 AA standards. Ensure you maintain these standards when using tokens.

  • All tokens meet WCAG 2.1 AA contrast requirements
  • Normal text: minimum 4.5:1 contrast ratio
  • Large text: minimum 3:1 contrast ratio
  • Don't rely solely on color to convey information
  • Test with color blindness simulators
  • Provide additional visual cues (icons, text) for critical information