Loading TAILWIND::COSMOS...
“Tailwind CSS v4 removes tailwind.config.js in favor of a CSS-first architecture using standard @theme directives, native CSS cascade layers (@layer), CSS variables, and modern color spaces (OKLCH, display-p3).”
The new CSS-first configuration using @theme, modern CSS color-mix, and zero-config builds.
/* Tailwind v4 CSS-First Configuration */
@import "tailwindcss";
@theme {
--color-cosmic-cyan: #06b6d4;
--color-cosmic-gold: #f59e0b;
--font-display: 'Syne', sans-serif;
--font-mono: 'JetBrains Mono', monospace;
}
.hero-banner {
font-family: var(--font-display);
background-color: var(--color-cosmic-cyan);
}:root {
--color-cosmic-cyan: #06b6d4;
--color-cosmic-gold: #f59e0b;
}
.bg-cosmic-cyan { background-color: var(--color-cosmic-cyan); }
.text-cosmic-gold { color: var(--color-cosmic-gold); }Import Tailwind v4 directly in CSS: "@import \"tailwindcss\";"
Declare custom tokens using "@theme { --color-brand: #06b6d4; }"
Tokens automatically generate matching utilities ("bg-brand", "text-brand", "border-brand")
Leverage modern native CSS variables for runtime dynamic theme switching
Native CSS "@theme" eliminates the JavaScript config runtime, slashing build times by over 500% and enabling instant HMR hot reloads.