Overview

Pick Tailwind for product UIs where a team shares tokens and components; pick CSS Modules when each component or page has bespoke styling that utilities would fight. As of 2026-10-01 Tailwind is at 4.3 (CSS-first configuration, Oxide engine, requires Chrome 111+, Safari 16.4+, Firefox 128+). Both compile to static CSS with no runtime, so the decision is about authoring model and team consistency.

Comparison

DimensionTailwind 4CSS Modules
Where styles liveUtility classes in markupSibling *.module.css file
Design tokens@theme block in CSS generates variables and utilitiesHand-written CSS custom properties
ScopingUtilities are self-scopingHashed class names per file
Consistency across a teamHigh by defaultDepends on review discipline
Component kitsshadcn/ui and others built on TailwindBring your own
Browser floorChrome 111, Safari 16.4, Firefox 128Any browser your CSS targets
ConfigCSS file; tailwind.config.js is no longer the defaultNone

Pick Tailwind when

Pick Tailwind for teams that value shared vocabulary and speed.

  • Define tokens once in CSS with @theme; utilities and variables follow. See tailwind.
  • Use it with shadcn and sort classes with the Prettier plugin so reviews skip ordering debates.
  • Internal tools and dashboards where consistency beats art direction.
@import "tailwindcss";
 
@theme {
  --color-brand-500: oklch(0.62 0.19 259);
}

Pick CSS Modules when

Pick CSS Modules when the CSS itself is the design work.

  • Brand-led pages with per-section art direction, complex selectors, container queries, or cascade layers (see css-cascade-layers).
  • Contributors who write plain CSS and should not learn a utility vocabulary.
  • Shared components that must work without a Tailwind build step.

Mixing

Mix at the boundary, not inside a component. Tailwind’s own docs advise against CSS Modules where avoidable: each module needs separate Tailwind processing and @apply requires @reference "../app.css". If a bespoke surface needs a module, use CSS variables from your theme inside it instead of @apply.

Migrate

CSS Modules to Tailwind: port tokens into @theme, then convert components leaf-first, deleting each .module.css once its component is done. Tailwind to CSS Modules is rare; expand utilities into rules rather than leaning on @apply. Move CSS-in-JS apps to either; see css-modules-vs-styled-components.

FAQ

Should I use Tailwind or CSS Modules for a React app?

Use Tailwind 4 for product UIs where a team shares tokens and components, such as internal tools and dashboards. Use CSS Modules when each component or page has bespoke styling that utilities would fight.

Can I use Tailwind and CSS Modules together?

Mix them at the boundary, never inside one component. Tailwind’s docs advise against CSS Modules where avoidable, because each module needs separate Tailwind processing and @apply requires @reference.

What browsers does Tailwind 4 support?

Tailwind 4 requires Chrome 111+, Safari 16.4+, and Firefox 128+. CSS Modules work in any browser your CSS targets.

Does Tailwind 4 still use tailwind.config.js?

No longer by default; Tailwind 4 uses CSS-first configuration with an @theme block that generates variables and utilities. Port tokens into @theme first when migrating from CSS Modules.