import { Meta, ColorPalette, ColorItem } from 'storybook/blocks';
<Meta title="Style Guide/Colors" />
Our color system provides semantic colors for consistent visual language across the application.
Color Principles#
- Meaningful Usage: Colors communicate meaning - use them consistently
- Accessibility First: All color combinations meet WCAG 2.1 AA contrast ratios
- Dark Mode Support: Every color has light and dark mode variants
- Semantic Naming: Use semantic names (
primary,error) not raw values
Primary Colors#
Primary colors represent the brand and are used for key actions, links, and emphasis.
<ColorPalette> <ColorItem title="Primary" subtitle="Brand color for primary actions (Lilith terracotta)" colors={{ 50: '#f7f1e2', 100: '#ede4cf', 200: '#e6dec6', 300: '#d9cfb7', 400: '#c97247', 500: '#9a3e1c', 600: '#823316', 700: '#7a2c12', 800: '#5a1f0d', 900: '#3e1f0e', 950: '#1f1a14', }} /> </ColorPalette>
Usage#
- Primary 600: Default button backgrounds, links
- Primary 700: Hover states
- Primary 500: Focus rings, light accents
- Primary 100-200: Backgrounds for selected items
// Primary button
<Button variant="primary">Submit</Button>
// Primary text link
<a className="text-primary-600 hover:text-primary-700">Learn more</a>
Semantic Colors#
Success Colors#
Used for positive feedback, confirmations, and successful states.
<ColorPalette> <ColorItem title="Success" subtitle="Positive feedback and confirmations" colors={{ 50: '#f7f1e2', 100: '#ede4cf', 300: '#a09680', 500: '#3f5e2b', 600: '#2e4a1f', 700: '#2e4a1f', 900: '#1f1a14', }} /> </ColorPalette>
Error Colors#
Used for errors, destructive actions, and critical warnings.
<ColorPalette> <ColorItem title="Error" subtitle="Error states and destructive actions" colors={{ 50: '#f7f1e2', 100: '#ede4cf', 300: '#d9cfb7', 500: '#a64a2a', 600: '#7a2c12', 700: '#7a2c12', 900: '#5a1f0d', }} /> </ColorPalette>
Warning Colors#
Used for caution states and important notices.
<ColorPalette> <ColorItem title="Warning" subtitle="Caution and attention states (Lilith honey)" colors={{ 50: '#f7f1e2', 100: '#ede4cf', 300: '#d9cfb7', 500: '#c89657', 600: '#b58947', 700: '#9a7e3a', 900: '#3b3325', }} /> </ColorPalette>
Neutral Colors#
Neutrals form the foundation of the interface - backgrounds, text, borders.
<ColorPalette> <ColorItem title="Neutral" subtitle="UI foundations (Lilith ink and paper)" colors={{ 50: '#f7f1e2', 100: '#f1ebdd', 200: '#ede4cf', 300: '#d9cfb7', 400: '#a09680', 500: '#6f6555', 600: '#3b3325', 700: '#1f1a14', 800: '#1f1a14', 900: '#1f1a14', 950: '#1f1a14', }} /> </ColorPalette>
Text Colors#
| Usage | Light Mode | Dark Mode |
|---|---|---|
| Primary text | neutral-900 |
neutral-100 |
| Secondary text | neutral-600 |
neutral-400 |
| Disabled text | neutral-400 |
neutral-600 |
| Placeholder | neutral-500 |
neutral-400 |
Background Colors#
| Usage | Light Mode | Dark Mode |
|---|---|---|
| Page background | white |
neutral-900 |
| Card background | white |
neutral-800 |
| Hover state | neutral-100 |
neutral-800 |
| Disabled | neutral-100 |
neutral-900 |
Border Colors#
| Usage | Light Mode | Dark Mode |
|---|---|---|
| Default | neutral-200 |
neutral-700 |
| Strong | neutral-300 |
neutral-600 |
| Subtle | neutral-100 |
neutral-800 |
Color Accessibility#
All color combinations are tested against WCAG 2.1 guidelines:
- AA Standard (4.5:1): Normal text on backgrounds
- AA Large (3:1): Large text (18px+) and UI components
- AAA Standard (7:1): Enhanced contrast for better readability
Tested Combinations#
| Foreground | Background | Ratio | Level |
|---|---|---|---|
neutral-900 |
white |
17.4:1 | AAA |
neutral-700 |
white |
8.5:1 | AAA |
primary-600 |
white |
4.6:1 | AA |
error-600 |
white |
4.5:1 | AA |
success-700 |
white |
4.7:1 | AA |
Dark Mode#
All semantic colors automatically adjust in dark mode:
// Automatic dark mode support
<div className="bg-white dark:bg-neutral-900">
<p className="text-neutral-900 dark:text-neutral-100">
Text adapts to theme
</p>
</div>
Dark Mode Adjustments#
- Backgrounds: Shift from light (
white) to dark (neutral-800/900) - Text: Shift from dark (
neutral-900) to light (neutral-100) - Borders: Shift from light (
neutral-200) to dark (neutral-700) - Accents: Use lighter shade variants (e.g.,
primary-400instead ofprimary-600)
Usage Guidelines#
Do#
- Use semantic color names (
bg-primary-600) not hex values - Ensure sufficient contrast for all text
- Test all color combinations in both light and dark modes
- Use opacity for subtle variations (
bg-black/50)
Don't#
- Use hardcoded hex values in components
- Create custom colors outside the system
- Use colors that don't meet accessibility standards
- Forget to test dark mode variants