Theme token converter for Tailwind CSS v4
Paste a static theme object or a configuration containing theme. Preview CSS-first declarations and review what still needs manual migration.
Convert static theme tokens to CSS locally. This tool does not execute configuration code or compile Tailwind.
How it works
Supported legacy theme groups map to documented v4 namespaces, such as colors to --color-*, fontFamily to --font-*, fontSize to --text-*, spacing to --spacing-* and screens to --breakpoint-*. Nested color names flatten with hyphens; a color DEFAULT supplies its parent’s value.
Groups directly under theme replace that namespace using a wildcard initial declaration. Groups under theme.extend add or override tokens. Extensions merge into replacements before output. Font-size tokens emit a size variable and three companion variables. Omitted line-height, letter-spacing and font-weight options are set to initial so existing theme defaults do not survive an override.
All values remain text; there is no unit conversion or rounding. Use @theme inline when appropriate for references to other CSS variables. Copy the block into a v4 stylesheet and compile your application to review the result. Preview here means CSS text, not generated utility rendering.
Worked examples
Extend a color palette
{theme:{extend:{colors:{brand:{DEFAULT:"#2563eb","600":"#1d4ed8"}}}}} emits 2 declarations: --color-brand: #2563eb; and --color-brand-600: #1d4ed8;. It does not reset the color namespace.
Spacing and font-size options
{theme:{extend:{spacing:{"18":"4.5rem"},fontSize:{hero:["3rem",{lineHeight:"1.1"}]}}}} emits 5 declarations: --spacing-18: 4.5rem;, --text-hero: 3rem; --text-hero--line-height: 1.1;, and initial resets for the letter-spacing and font-weight companions.
Accepted input and migration scope
Accepts JSON plus single-quoted strings, unquoted identifier or integer keys, and trailing commas. Comments, module.exports, imports, functions, template strings, spreads and calls are rejected. Pasted JavaScript is never evaluated.
Supported groups: colors, fontFamily, fontSize, fontWeight, letterSpacing, lineHeight, screens, spacing, borderRadius, boxShadow, dropShadow, blur, aspectRatio, transitionTimingFunction and animation. Unsupported groups fail explicitly. Top-level settings outside theme are listed as not converted. Keyframes, plugins, complex screens, fractional/escaped names, font-family option tuples, non-color DEFAULT tokens and alpha placeholders require manual migration. CSS values are checked for safe declaration boundaries, not for every property’s semantic grammar.
Application limits: 256 KiB, 10,000 lines, 64 levels and 10,000 parsed values. The mapping report shows at most 200 rows.
Frequently asked questions
Does this replace the official upgrade tool?
Why does output contain --color-*: initial?
Can I paste a JavaScript config file?
Are CSS values or colors converted?
Will every old utility behave the same?
Sources
- Tailwind CSS v3 — font-size tuples and options (checked 2026-11-15)
- Tailwind CSS — theme variables and namespaces (checked 2026-11-14)
- Tailwind CSS — v4 upgrade guide (checked 2026-11-14)
- Tailwind CSS — font-size theme options (checked 2026-11-14)
- RFC 8259 — static JSON input (checked 2026-11-14)
Last reviewed 2026-11-14; next review due by 2027-02-12. The method is written out above so you can check our math.