Tailwind Config

Standard Suite

Themes:|Palette:
Generated Palette (3 shades)
100
100: #e0e7ff
500
500: #6366f1
900
900: #312e81
50 (Light)500 (Primary)950 (Dark)

Overview

+14.5%
Target Progress70%

Free Tailwind CSS Config Generator - Build Accessible Themes Visually

Create production-ready Tailwind themes in 5 minutes. Visual editor, JSON control, and WCAG accessibility checking - all in one free tool. No signup required. No credit card. Just open it and start building.

Why naive lighten and darken ramps look wrong

Every palette assumes that equal steps on the scale look like equal steps to the eye. That assumption is usually wrong.

The standard way of building a color scale is mechanical: take a brand color at step 500, mix it toward white for the lighter steps and toward black for the darker ones, evenly spaced from 50 to 950. This page generates its starting palette exactly that way from a seed hex, interpolating linearly in sRGB. It works, but it is not how human vision works.

sRGB is a display encoding, not a perceptual model. Equal numeric moves in the three channels do not produce equal changes in perceived lightness, and mixing toward white or black drags the hue along with the brightness. Yellows collapse into muddy olives as they darken; saturated blues wash out into pastels before the ramp feels finished. Adjacent steps can end up nearly identical while others jump far enough that the middle reads as a different color family.

HSL only looks like a fix. Its lightness is a geometric property of the model, not a measure of perceived brightness, so two colors with the same HSL lightness can read as noticeably different. That is why HSL ramps so often go pale or dingy mid-scale.

OKLCH closes the gap. It models color as lightness L (0 to 1), chroma C, and hue angle H (0 to 360 degrees), and it is perceptually uniform: equal steps in L correspond to roughly equal steps in perceived brightness. Hold H and C constant, step L evenly from about 0.97 down to 0.35, and the ramp advances at a steady visual pace from 50 to 950 with the hue locked.

The practical workflow is a hybrid: generate the seed ramp in the tool, then normalize it by converting each step to OKLCH, keeping the hue, and redistributing lightness evenly. The Tailwind config guide covers the configuration side in more depth.

Contrast is a number, not an opinion

WCAG 2.1 defines contrast with a formula, and every check this tool runs uses the real one. Each sRGB channel is first linearized, because the ratio must be measured against light output, not encoded values. For a channel value c between 0 and 1: if c <= 0.03928, the linear value is c / 12.92; otherwise it is ((c + 0.055) / 1.055) ^ 2.4.

Relative luminance L is 0.2126 * R + 0.7152 * G + 0.0722 * B. The weights are not arbitrary: the eye is most sensitive to green light, then red, then blue. The contrast ratio for luminances L1 (lighter) and L2 (darker) is (L1 + 0.05) / (L2 + 0.05). WCAG 2.1 thresholds are 4.5:1 for normal text at AA, 3:1 for large text at AA (18.66px bold or 24px regular and above), 3:1 for UI components under criterion 1.4.11, and 7:1 for normal text at AAA.

Two details trip up teams. The 3:1 large-text threshold is an exception, not a blanket permission: a brand color that passes in body copy at 14px still fails. And contrast is measured against the rendered background, so a color that passes on white can fail on a tinted surface. This tool's accessibility tab checks your pairs against the actual surface tokens in the config, with a full foreground-by-background matrix, flagging anything under 4.5:1 outside of background and surface roles.

Moving from tailwind.config.js to CSS-first @theme

Tailwind CSS v4 replaced the JavaScript config file with a CSS-first model. In v3, tokens lived in tailwind.config.js under theme.extend. In v4, they live directly in CSS inside an @theme block, and utilities are derived from the custom properties:

@import "tailwindcss"; @theme {--color-primary: #6366f1; --color-brand-500: #6366f1; --font-sans: "Inter", system-ui, sans-serif;}

The namespace after -- decides which utilities appear: --color-* becomes bg-primary, text-primary, and the rest; --font-* becomes font-sans.

Migration is mostly mechanical, with three places that bite. Anything dynamic in the v3 config must become static in @theme or use @theme inline when it must resolve at runtime. Plugins and custom variants move from plugins: [] in JS to @plugin and @custom-variant in CSS, and darkMode: "class" becomes @custom-variant dark (&:where(.dark, .dark *));. The tool exports the @theme block directly from your edited config, reducing the token migration to a copy operation.

Tokens that survive the handoff

A theme earns its keep only if the same values reach the codebase, the design files, and the documentation. That is what the DTCG format is for. The Design Tokens Community Group, a W3C community group, standardized tokens as structured data: each token carries a value and a type, with optional $description and $extensions metadata, nested into groups that flatten into dot-separated paths like color.brand.500. One source file can then become CSS variables, SCSS variables, a JavaScript module, or Figma input without anyone retyping hex values.

This tool's export panel ships the common transforms: Tailwind v4 @theme, Figma-compatible tokens JSON, CSS custom properties, SCSS and LESS variables, and a JS module. The Figma JSON uses the value and type: "color" shape token importers expect, so plugins like Tokens Studio can turn it into Figma variables in one import.

Two practices keep the sync honest. Treat the exported JSON as the source of truth and regenerate everything downstream from it, rather than hand-editing values in two places; the moment a hex value differs between Figma and production, you have two design systems. And keep the semantic layer: tokens named color.brand.500 survive a rebrand, while tokens named color.indigo.500 lock the hue into every file that references them.


Frequently Asked Questions

sRGB mixing is simple and works everywhere with no color space conversion, which makes it a good interactive starting point. OKLCH is better for the finished scale because its lightness axis is perceptually uniform.
The tinted surface, because that is where the text renders. Contrast is a property of a rendered pair, not of a color in isolation. When a color fails on the surface, deepen the foreground a step or two down the scale rather than lightening the surface.
For tokens, no. `@theme` in CSS replaces `theme.extend` entirely, and the tool exports the block ready to paste. Keep a config file only for cases v4 cannot express in CSS, such as unusual content detection setups. Most migrated projects delete the file.
Through an importer plugin such as Tokens Studio, which reads the token JSON and creates or updates Figma variables from it. This tool's Figma export uses the `value` and `type` structure those importers expect, flattened to dot-path names like `color.brand.500`. Re-importing after a palette change updates the variables in place.

Ship a Theme Built on Perceptual Color Science

Configuration shouldn't be the slow part of building something. A well-designed theme generator removes the friction from that part of the process so you can spend your time on the work that's actually specific to what you're building.

This tool is free, requires no account, and exports to every format you're likely to need. The WCAG checker means you can ship with confidence rather than hoping your color choices hold up under scrutiny. The live preview means you test against real layouts rather than abstract color wheels. Open the generator, apply a preset or start from scratch, and have a production-ready Tailwind configuration in a few minutes.

For further reference: the official Tailwind CSS documentation covers the full configuration API, and the WCAG guidelines are the authoritative source on accessibility requirements.

In-depth guide

Tailwind CSS Config Guide: Custom Colors, Fonts & Theme

Build a custom theme with brand colors, fonts, spacing, dark mode, and the v4 CSS-first way, with copy-paste examples.

Read the guide