Skip to content
Home/Learning Hub/Tailwind CSS
Tailwind CSS• 8 min readBeginner

Tailwind CSS v4 Complete Guide: Zero-Config & CSS Variables

Everything you need to know about Tailwind CSS v4's new engine, CSS-first configuration, and direct Figma token mapping.

Key Takeaways:

  • ✓Tailwind v4 removes tailwind.config.js in favor of @theme in CSS.
  • ✓CSS variables are the native source of truth.
  • ✓Theme swapping (light/dark) works instantly without flash of unstyled content.
Tailwind v4 @theme configuration in globals.css
@import "tailwindcss";

@theme inline {
  --color-brand: #4ade80;
  --color-bg: #f3f8f4;
  --color-surface: #e8f5e9;
  --color-ink: #0a1612;

  --font-sans: var(--font-figtree), system-ui, sans-serif;
  --font-serif: var(--font-instrument-serif), Georgia, serif;
}

[data-theme="dark"] {
  --color-bg: #0a1612;
  --color-surface: #0f221c;
  --color-ink: #eaf6ec;
}
Tailwind CSS v4 introduces an entirely new Oxide engine written in Rust and eliminates the legacy `tailwind.config.js` in favor of native CSS `@theme` directives. ### Why Tailwind v4 is a game changer for Design Systems: 1. **CSS-First Configuration:** Tokens live in your `globals.css` as first-class CSS variables. 2. **Instant Hot-Reloading:** Sub-millisecond build performance. 3. **Native CSS Variables:** No complex build-step mapping for light and dark modes. ### Setting up Custom Design Tokens: In your main CSS entry point, simply declare the `@theme` block: