Tailwind Theme Generator
Generate a full Tailwind + shadcn/ui theme from a few base colors.
Pick a primary, accent and neutral color and get a complete Tailwind + shadcn/ui theme — full color scales, light and dark tokens, a live preview, and copy-ready exports. Free. No sign-up. Runs in your browser, nothing is uploaded.
Primary scale (50–950)
Accent scale (50–950)
Live preview
Create your account
Enter your email below to get started.
Click any swatch in the scales to copy its hex. Your three base colors are encoded in the address bar, so the share link rebuilds the exact theme.
Choose three colors, a primary (your brand color), an accent for highlights and a neutral that sets the temperature of your grays, and the generator builds two full 50–950 scales plus the light and dark shadcn/ui tokens that go with them. A mock card with buttons and an input shows the theme in light and dark mode before you export it as a shadcn/ui theme (current OKLCH format or the older HSL one), a Tailwind v3 config, a Tailwind v4 @theme block or JSON. Click any swatch to copy its hex.
Which export for which project?
| Your project | Export | Where it goes |
|---|---|---|
| Tailwind v4, plain | Tailwind v4 theme | Your main CSS file, after @import "tailwindcss";. Gives you bg-primary-500, text-accent-700 and so on |
| Tailwind v3 | Tailwind v3 config | tailwind.config.js under theme.extend.colors |
| shadcn/ui on Tailwind v4 (current) | shadcn/ui (v4, OKLCH) | Your global CSS after the imports, replacing the existing :root, .dark and @theme inline blocks |
| shadcn/ui on Tailwind v3 | shadcn/ui (v3, HSL) | Your global CSS, as it is: :root for light, .dark for dark |
| Design tokens pipeline, native app, design tool | JSON | Both scales plus light and dark semantic tokens as plain data |
Tailwind v4, released in 2025, moved configuration into CSS: colors are defined as --color-* variables in an @theme block, and a tailwind.config.js is only read if you load it with the @config directive. If you started a project recently, you are almost certainly on v4.
OKLCH or HSL: which shadcn/ui format you need
shadcn/ui changed its theme format when it moved to Tailwind v4. The old format stored bare HSL numbers and let tailwind.config.js wrap them in hsl(var(--primary)). The current one stores complete colors, written in oklch(), and maps them to utilities in CSS:
:root {
--primary: oklch(0.461 0.272 268.5);
}
@theme inline {
--color-primary: var(--primary);
}
The v4 export gives you exactly that shape: :root and .dark with every token in OKLCH, the @custom-variant dark line that makes the .dark class work, and an @theme inline block with the --color-* mappings and --radius-sm to --radius-xl. The numbers are converted from the same sRGB colors as the preview, so the two formats render identically; OKLCH just makes lightness steps perceptually even when you edit a value by hand.
Mixing formats is where projects break. A bare 239 84% 54% pasted into a v4 project is not a color, so buttons lose their background, and an oklch() value in a v3 setup ends up as hsl(oklch(…)). Check which file your project has: a tailwind.config.js with hsl(var(--…)) means v3, an @theme inline block in globals.css means v4.
How the scale is built, and what to check
Each step keeps your hue and uses a fixed lightness: 97% at 50, then 94, 86, 76, 64, 54 at 500, 46, 38, 30, 22 and 14% at 950. The lightest steps lose a little saturation so tints do not look neon; the darkest gain some so shades stay rich instead of muddy.
Two consequences are worth knowing:
- Your base color is not guaranteed to be a step. With the default indigo
#6366F1(lightness 67%), the scale goes#8E90F5at 300,#5659F0at 400 and#272AECat 500, so the brand color itself falls between 300 and 400. - The 500 can look different from your brand. For a light brand color, 500 is darker than the original; for a very dark one, lighter. Use the scale for tints, borders and hover states, and reference the exact brand hex where it has to be exact.
For the tints and shades of a single color without a full theme, the color shades & tints generator is the lighter tool.
Bright brand colors get a dark button label
The light-mode primary keeps your hue and holds its lightness between 40% and 54%. That is dark enough for white text with deep colors and far too light with bright ones: white on a yellow primary measures 1.47:1. So for primary-foreground and accent-foreground, in light and dark mode, the generator computes the WCAG contrast of two candidates, near-white and a dark tint of the same hue, and keeps the stronger one:
| Base color | Light-mode primary | Chosen foreground | Contrast | White text would give |
|---|---|---|---|---|
Indigo #6366F1 | #272AEC | near-white #FAFAFA | 7.65:1 | 7.65:1 |
Sky #0EA5E9 | #0DA2E7 | dark #152228 | 5.68:1 | 2.74:1 |
Green #22C55E | #21C45D | dark #15281C | 6.74:1 | 2.21:1 |
Yellow #FACC15 | #FACC14 | dark #282415 | 10.13:1 | 1.47:1 |
All four pass WCAG AA for normal text (4.5:1). The one weak zone is a saturated mid-tone whose luminance sits between the two candidates, where the better of the two can drop to about 4:1: enough for bold button labels (AA large text needs 3:1), short of 4.5:1 for small text. If that happens, use a darker step from the scale as your primary and confirm it with the color contrast checker.
Choosing the three inputs
- Primary is used for buttons, links, focus rings (
ring) and the selected state. Pick the color you want people to click. - Accent gets its own 50–950 scale and the
accenttoken. It works best a good distance around the color wheel from the primary; if you have nothing in mind, the color palette generator suggests combinations. - Neutral decides the hue of every gray: backgrounds, cards, borders, muted text. Its saturation is capped at 20%, so even a blue neutral produces subtle cool grays rather than blue surfaces. A warm stone, a cool slate or a pure zinc changes the mood of the whole UI more than people expect.
Everything is plain color math in your browser, with no account and no AI step, and the result is standard CSS and JSON you can take into any project.
Frequently asked questions
Related tools
All Color tools →- Color Palette GeneratorGenerate beautiful color palettes — press space, lock the ones you like, share the link.
- Color Shades & Tints GeneratorTurn one color into a full 50–950 tint and shade scale, ready for Tailwind.
- Color ConverterConvert any color between HEX, RGB and HSL instantly — pick, preview and copy in one place.
