What Changed in v4
| Feature | v3 | v4 |
|---|---|---|
| Config | tailwind.config.js |
CSS-first @theme |
| Content detection | Manual content: [...] |
Automatic |
| Build speed | Fast | 10x faster (Rust) |
| Custom values | Config file | text-[14px] inline |
| Dark mode | darkMode: 'class' |
Automatic |
Zero-Config Setup
/* Just import — no config file needed */
@import "tailwindcss";Tailwind v4 automatically finds and scans your template files.
CSS-First Configuration
@import "tailwindcss";
@theme {
--color-brand: #3b82f6;
--font-display: "Inter", sans-serif;
--breakpoint-3xl: 1920px;
}Common Patterns
Card:
<div class="rounded-2xl bg-white p-6 shadow-md dark:bg-gray-800">
<h2 class="text-xl font-bold">Title</h2>
<p class="mt-2 text-gray-600 dark:text-gray-300">Description</p>
</div>Responsive Grid:
<div class="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3">
<!-- cards -->
</div>Flex Layout:
<div class="flex items-center justify-between">
<span>Left</span>
<span>Right</span>
</div>AI-Native
Tailwind is the default styling output for AI tools:
- v0.dev generates Tailwind + shadcn/ui
- Cursor writes Tailwind when asked for styling
- Claude Code uses Tailwind in web projects
- Bolt.new defaults to Tailwind
Key Stats
- 90,000+ GitHub stars
- v4 engine rewritten in Rust
- 10x faster builds
- Zero-config automatic detection
- AI tools' default CSS framework
FAQ
Q: What is Tailwind CSS?
A: A utility-first CSS framework where you style elements with classes like flex, p-4, text-lg instead of writing custom CSS. Version 4 is 10x faster with zero config.
Q: Is Tailwind free? A: Yes, fully open-source under MIT license.
Q: Do I still need tailwind.config.js in v4?
A: No, v4 uses CSS-first configuration with @theme and automatic content detection. Config files are optional.