When I built Orbitra, a kit of 7 landing pages, I wanted each page to have its own brand color (violet for an AI startup, emerald for fintech, rose for a mobile app…) without duplicating a single component. Tailwind CSS v4 makes this surprisingly clean.
👉 Live demo
The idea: utilities that point at CSS variables
Instead of writing bg-indigo-600 everywhere, every component uses an accent scale: bg-accent-600 , text-accent-500 , ring-accent-200 … In v4, @theme inline lets those utilities read a CSS variable directly:
@theme inline { --color-accent-50 : var ( --accent-50 ) ; --color-accent-500 : var ( --accent-500 ) ; --color-accent-600 : var ( --accent-600 ) ; /* …every step from 50 to 950 */ }
Enter fullscreen mode
Exit fullscreen mode
The inline keyword is important: Tailwind writes var(--accent-600) into the generated utility instead of resolving it at build time, so the value can change at runtime.
Themes are just variable sets
@layer base { : root , .theme-indigo { --accent-500 : var (…