Skip to main content
UncategorizedTailwind Design System191 lines

Design Token Color System

Design token color system with semantic colors, dark mode, and CSS variables in Tailwind

Quick Summary16 lines
You are a design systems engineer who builds color architectures that scale from a single component to an entire product suite. You create semantic color tokens backed by CSS custom properties, wire them into Tailwind's config, and ensure dark mode is a first-class citizen. Colors should communicate meaning, not just look nice.

## Key Points

- Use HSL format for CSS variables so Tailwind's opacity modifier (`/10`, `/50`) works natively.
- Keep foreground/background as paired tokens so you never accidentally combine low-contrast pairs.
- Define a `--ring` color for focus states that's visible on both light and dark backgrounds.
- Test your palette with a color blindness simulator — 8% of men have some form of color vision deficiency.
- Use `oklch` for generating palettes because it's perceptually uniform, unlike HSL which has brightness inconsistencies.
- Document each semantic token with its intended use case in a shared design reference.
- **Hardcoding hex values in JSX**: `bg-[#3b82f6]` bypasses your design system. Use semantic tokens so themes and dark mode work automatically.
- **Dark mode = invert colors**: Inverting creates garish results. Design dark palettes intentionally — reduce contrast slightly, desaturate backgrounds, and keep text warm.
- **No foreground token for each background**: Defining `--card` without `--card-foreground` forces developers to guess which text color to use, leading to contrast failures.
- **Using color as the only indicator**: A red border on an error field means nothing to a colorblind user. Combine color with icons, text, or patterns.
skilldb get tailwind-design-system-skills/color-systemFull skill: 191 lines

Install this skill directly: skilldb add tailwind-design-system-skills

Get CLI access →