Convert a shadcn/ui theme from Tailwind v3 to v4
Paste a Tailwind v3 shadcn/ui globals.css with HSL variables and get Tailwind v4 CSS with OKLCH colors, @theme inline mappings and chart and sidebar tokens.
Your Tailwind v3 CSS
How it works
- 1
Paste the :root and .dark blocks from your existing globals.css. Bare HSL channels (222.2 47.4% 11.2%), hsl(), hex and rgb all work.
- 2
Every color is converted to OKLCH, missing tokens such as chart-1…5 and sidebar-* are derived from your palette, and a dark mode is generated if you don't have one.
- 3
Copy the Tailwind v4 CSS, or open the converted theme in the editor to keep tweaking it.
FAQ
Do I still need tailwind.config.js?
Not for colors. In Tailwind v4 the @theme inline block in your CSS replaces the colors and borderRadius sections of the config file. The output includes it.
Will my colors change?
No. OKLCH can represent every sRGB color, so converted colors look identical. Only the notation changes.
Is my CSS uploaded anywhere?
No. Conversion runs entirely in your browser.