ConfigsApr 6, 2026·2 min read

Tailwind CSS v4 — Utility-First CSS Framework

The most popular utility-first CSS framework, now with v4 engine rewritten in Rust. 10x faster builds, automatic content detection, and zero-config setup. 90,000+ GitHub stars.

TL;DR
Tailwind CSS v4 delivers 10x faster builds via a Rust engine, automatic content detection, and zero-config setup for utility-first CSS.
§01

What it is

Tailwind CSS is the most popular utility-first CSS framework. Version 4 rewrites the core engine in Rust, delivering 10x faster build times, automatic content detection (no more configuring content paths), and a simplified setup that requires zero configuration files.

Tailwind targets frontend developers who prefer composing UI directly in HTML with utility classes rather than writing custom CSS files. It is used by teams of all sizes, from solo developers to large enterprises.

§02

How it saves time or tokens

Traditional CSS requires naming classes, organizing stylesheets, and managing specificity conflicts. Tailwind eliminates this: you write flex items-center gap-4 p-6 bg-white rounded-xl directly in your HTML. The v4 engine detects which classes you use automatically, so the final CSS bundle contains only what is needed.

For AI-generated UIs, Tailwind is ideal because LLMs can produce working UI code in a single HTML file without creating separate CSS files.

§03

How to use

  1. Install Tailwind CSS v4:
npm install tailwindcss @tailwindcss/vite
  1. Import Tailwind in your CSS:
/* app.css */
@import "tailwindcss";
  1. Use utility classes in your HTML:
<div class="flex items-center gap-4 p-6 bg-white rounded-xl shadow-md">
  <img class="w-12 h-12 rounded-full" src="avatar.jpg" />
  <div>
    <h2 class="text-lg font-semibold text-gray-900">Jane Smith</h2>
    <p class="text-sm text-gray-500">Software Engineer</p>
  </div>
</div>
§04

Example

<!-- Responsive card grid with Tailwind v4 -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 p-8">
  <div class="bg-white rounded-2xl p-6 shadow-sm hover:shadow-lg transition-shadow">
    <h3 class="text-xl font-bold text-gray-900">Project Alpha</h3>
    <p class="mt-2 text-gray-600">A description of the project.</p>
    <div class="mt-4 flex gap-2">
      <span class="px-2 py-1 bg-blue-100 text-blue-800 text-xs rounded-full">React</span>
      <span class="px-2 py-1 bg-green-100 text-green-800 text-xs rounded-full">TypeScript</span>
    </div>
  </div>
</div>
§05

Related on TokRepo

§06

Common pitfalls

  • Tailwind v4 has breaking changes from v3. The configuration file format changed, and some utility names were renamed. Check the migration guide before upgrading.
  • Long lists of utility classes can make HTML hard to read. Extract common patterns into components (React/Vue/Svelte) rather than creating custom CSS classes.
  • Tailwind's JIT engine in v4 requires a build step. It does not work by including a CDN script in production (the CDN version is for prototyping only).

Frequently Asked Questions

What changed in Tailwind CSS v4 compared to v3?+

The engine was rewritten in Rust for 10x faster builds. Content detection is automatic (no content paths in config). The setup is zero-config with just an @import statement. Some utility names and configuration patterns changed.

Does Tailwind CSS work with React and Vue?+

Yes. Tailwind works with any frontend framework or plain HTML. Use utility classes directly in JSX (React), templates (Vue), or any HTML-producing framework. Component extraction replaces the need for CSS abstractions.

Is Tailwind CSS production-ready?+

Yes. Tailwind is used by thousands of production applications. The build step produces optimized, minified CSS containing only the utilities you use. Final bundle sizes are typically 5-15KB gzipped.

Does Tailwind replace CSS knowledge?+

No. Tailwind maps utility classes to CSS properties. Understanding CSS (flexbox, grid, positioning, specificity) is still necessary. Tailwind is a productivity layer on top of CSS, not a replacement for understanding it.

Can I customize Tailwind colors and spacing?+

Yes. Tailwind v4 uses CSS custom properties and @theme directives for customization. You can extend or override the default design tokens (colors, spacing, fonts) in your CSS file.

Citations (3)
🙏

Source & Thanks

Created by Adam Wathan and Tailwind Labs. Licensed under MIT.

tailwindcss — ⭐ 90,000+

Thanks for making CSS productive and AI-friendly.

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets