--- id: wiki-2026-0508-tailwind-css-v4 title: Tailwind CSS v4 category: 10_Wiki/Topics status: verified canonical_id: self aliases: [Tailwind v4, TailwindCSS 4, Tailwind 4.x] duplicate_of: none source_trust_level: A confidence_score: 0.95 verification_status: applied tags: [css, tailwind, frontend, styling, lightning-css] raw_sources: [] last_reinforced: 2026-05-10 github_commit: pending tech_stack: language: css framework: tailwindcss-v4 --- # Tailwind CSS v4 ## 매 한 줄 > **"매 Tailwind v4 는 CSS-first 의 rebuild — JS config 의 retire, Lightning CSS engine, 5x faster build"**. 매 2025 Q1 stable release. 매 v3 의 `tailwind.config.js` → v4 의 `@theme {}` CSS-native. 매 modern CSS feature (cascade layers, container queries, color-mix, @starting-style) 의 first-class 의 support. ## 매 핵심 ### 매 v4 의 break (vs v3) - **JS config retired**: `tailwind.config.js` → `@theme` directive in CSS. - **PostCSS plugin → dedicated**: `@tailwindcss/postcss` or Vite plugin (`@tailwindcss/vite`). - **Lightning CSS engine**: Rust-based, 5x faster, native vendor prefixing + nesting. - **Single CSS import**: `@import "tailwindcss";` (replaces 3-line directives). - **Auto content detection**: heuristic-based, manual `content: [...]` 의 unnecessary in most cases. - **CSS variables for everything**: theme tokens 의 `--color-blue-500` 등 native CSS var. - **Container queries**: built-in `@container` utility. - **3D transforms, color-mix(), @starting-style**: modern CSS feature 의 utility. ### 매 install (2026) ```bash # Vite npm install tailwindcss @tailwindcss/vite # PostCSS npm install tailwindcss @tailwindcss/postcss # CLI npm install tailwindcss @tailwindcss/cli ``` ### 매 응용 1. **Next.js 15 / Remix / SvelteKit**: Vite plugin 의 default. 2. **Design system**: `@theme` 의 token export → tailwind + native CSS 의 share. 3. **Container query layout**: 매 truly responsive component. ## 💻 패턴 ### 1. CSS-first config (`app.css`) ```css @import "tailwindcss"; @theme { --color-brand-50: oklch(97% 0.02 250); --color-brand-500: oklch(60% 0.18 250); --color-brand-900: oklch(20% 0.06 250); --font-display: "Inter Display", "ui-sans-serif", system-ui; --radius-lg: 14px; --spacing-section: 5rem; --breakpoint-3xl: 1920px; } /* Custom variants */ @custom-variant dark (&:where(.dark, .dark *)); ``` ### 2. Vite integration (`vite.config.ts`) ```typescript import { defineConfig } from "vite"; import tailwindcss from "@tailwindcss/vite"; export default defineConfig({ plugins: [tailwindcss()], }); ``` ### 3. Container queries ```html