Tailwind CSS v4 Architecture: CSS-First Configuration and Performance
Exploring the engine rewrite of Tailwind CSS v4 with Oxide, pure CSS configuration via @theme, lightning-fast compilation, and migration best practices.
Tailwind CSS v4 is a total engine rewrite from the ground up. Gone is the JavaScript-based tailwind.config.js file; in its place stands a CSS-first configuration system powered by the Rust-based Oxide engine.
What Changed in Tailwind CSS v4?
- Oxide Rust Engine: Up to 10x faster compilation with instant incremental rebuilds.
- Pure CSS Configuration: Configure design tokens using
@themedirectives inside standardmain.css. - Automatic Content Detection: No more manual
content: [...]glob arrays. Tailwind automatically discovers templates in your workspace. - Native CSS Variables Integration: All design tokens map directly to native CSS custom properties.
Configuring @theme in Tailwind v4
Here is an example of our minimalist brutalist theme configuration:
@import "tailwindcss";
@theme {
--font-sans: "Geist Sans", -apple-system, BlinkMacSystemFont, sans-serif;
--font-mono: "Geist Mono", monospace;
/* Custom Color Tokens */
--color-brand-black: #0a0a0a;
--color-brand-zinc: #27272a;
--color-brand-accent: #3b82f6;
/* Strict 8px Brutalist Corner Radius */
--radius-sm: 8px;
--radius-md: 8px;
--radius-lg: 8px;
--radius-xl: 8px;
/* Flat Brutalist Shadows (Disabled) */
--shadow-sm: none;
--shadow-md: none;
--shadow-lg: none;
}Migration Tips from v3
- Replace
@tailwind base;,@tailwind components;,@tailwind utilities;with a single@import "tailwindcss";. - Remove
postcss.config.jsif you are using@tailwindcss/viteor@tailwindcss/postcss. - Replace
theme.extendJavaScript configs with declarative@themeblocks.
Tailwind v4 delivers cleaner codebases and eliminates build friction for modern web apps.