Tailwind CSS Handbook v4.3

Build interfaces without leaving your markup.

A practical, production-focused guide to Tailwind CSS v4 — the CSS-first architecture, every core concept, real component patterns, and an honest account of what changed since v3.

Start here#

What changed in v4#

Tailwind v4 is a rewrite, not a point release. If you learned Tailwind on v3, these five changes account for most of the friction:

AreaTailwind v3Tailwind v4
Configurationtailwind.config.js@theme in your CSS
Entry point@tailwind base/components/utilities@import "tailwindcss"
Content pathscontent: [...] arrayAutomatic source detection
PostCSS plugintailwindcss@tailwindcss/postcss
Colour formatrgb() / hexoklch()

Learning path#

Follow this order if you are new. Each step assumes only the ones above it.

  1. Install Tailwind — pick Vite, PostCSS or the CLI and get a build running.
  2. Write your first utilities — learn to read a class name.
  3. Lay things out — Flexbox and Grid cover almost every layout you will build.
  4. Go responsive — mobile-first breakpoints, then container queries.
  5. Add state — hover, focus, disabled, group-* and peer-*.
  6. Support dark mode — the media strategy, then the class strategy.
  7. Own your design tokens — @theme, colours, spacing, typography.
  8. Extend Tailwind — custom utilities, variants and plugins.
  9. Ship it — production builds, bundle size and performance.

See the annotated version at Learning Path.

Browse by topic#

About this handbook#

Every code sample here targets Tailwind CSS v4.3. Where a technique only applies to older versions it is labelled explicitly:

Current works in v4.3   New in v4 introduced by the rewrite   Legacy v3-era, still works   Deprecated removed or scheduled for removal

The original v3-era example pages this handbook grew out of are preserved, unchanged, in legacy/v3-examples/. They are kept for reference only — see Legacy Projects before copying anything out of them.