Back to guides
Color8 min read

Build an Accessible Tailwind Color System

A practical workflow for turning one brand color into a complete Tailwind palette with readable foreground colors, semantic tokens, and useful UI states.

Start with interface jobs

A strong Tailwind color system begins with jobs, not with a large color board. List the places where color has to make a decision: primary actions, secondary actions, links, warnings, destructive actions, surfaces, borders, focus rings, and selected states. This keeps the palette tied to user experience instead of turning it into decoration.

For most products, one primary hue and one neutral scale are enough for the first pass. Add supporting hues only when the interface needs them for status, priority, or data visualization. The smaller system is easier to test, easier to document, and less likely to produce inconsistent screens.

Generate shades, then test context

Tailwind-style palettes usually include eleven shades from 50 to 950. The lightest values work well for subtle backgrounds, the middle values work for buttons and accents, and the darkest values support readable text or deep surfaces. A generator can create the range quickly, but context decides whether a shade is usable.

Test each important shade against white, near-black, and the surrounding surface color. A button shade that looks beautiful in isolation may fail when it is placed inside a dense dashboard. Pay special attention to blue, yellow, and cyan families because perceived brightness can shift more than the numeric value suggests.

Use semantic tokens

After generating shades, assign them to semantic roles such as primary, primary-hover, primary-foreground, surface, muted, border, success, warning, and danger. Semantic names make the design system more resilient because components do not need to know why a particular shade was chosen.

Keep raw shade access available for experiments, but build production components on the semantic layer. When a brand color changes later, the update becomes a token mapping task instead of a hunt through hundreds of class names.

Document the contrast rules

For every action color, document the preferred foreground. For example, primary-600 may require white text, while primary-300 may require slate-950 text. Include hover and focus states in the same note, because those are the states most often missed during implementation.

TailG's palette tool helps by showing shade values and practical usage context. Treat the output as a starting point, then verify it with the actual typography size, font weight, and background used in your app.