A step-by-step guide for pasting Tailwind v4 @theme CSS variables from a shadcn theme generator into your globals.css. Covers the new CSS-first theming workflow, common mistakes, and how to fix them fast.

If you're using shadcn/ui with Tailwind v4, you will spend time in globals.css. That's normal.
Tailwind v4 pushes more theme work into CSS. You define tokens with @theme, and you keep light/dark values in :root and .dark. It's a clean setup, but easy to break when you paste stuff in the wrong order. The official docs call out that upgrading includes updating your CSS variables, so don't skip this step.
This guide shows the simple way: generate a theme, paste it, and fix the common mistakes fast.
@theme and @theme inline so Tailwind can "see" your CSS variables.:root and .dark, then reference them in @theme inline for Tailwind utilities.Use your shadcn Theme Generator to get a block you can paste. It should include:
:root values (light mode).dark values (dark mode)@theme systemIf your generator is outputting Tailwind v4-ready CSS variables, it's doing the right thing for this workflow.
Pick a Tailwind color family and shade, or your brand hex. Generate the theme CSS.
You want the full block: :root, .dark, and the variable definitions.
Where to paste?
globals.css:root and .dark blocks with the new onesMake sure you didn't remove or break the Tailwind directives (like @import "tailwindcss"; or the Tailwind base layer setup). Many guides show a pattern where globals.css imports Tailwind and defines theme tokens, then uses @theme inline to expose them.
Tailwind v4 sometimes needs a restart to "see" your new theme tokens.
@theme inline?.dark is actually loaded and toggled by your app (class on html or body)..dark has real values, not empty ones.This often means the @theme inline mapping is wrong, missing, or placed above the variables it references. A common Tailwind v4 pattern is:
:root / .dark@theme inline after, referencing those variables:root { :root { ... } } nested messIf you have templates, blocks, or shared UI kits, lock in the theme:
Once you've pasted your theme into globals.css, it can be useful to see how other themes are structured and how they "feel" in real UI. That way you can spot what you like, borrow naming patterns, and avoid reinventing the wheel. If you want a fast shortcut for that kind of inspiration, take a look through our shadcn theme collection, pick a preset, then tweak it so it still looks like you.
Founder @ shadcndesign.com

Learn how semantic colors work in shadcn/ui — why naming colors by role instead of hue keeps your UI consistent, accessible, and easy to theme across light and dark mode.

How shadcn/ui charts actually work: what ChartContainer does, how ChartConfig drives colors, and what breaks when you move from Recharts 2 to Recharts 3.

A practical 2026 comparison of Figma design system kits that map cleanly to code, with notes on variables, plugins, maintenance, and pricing.