Introducing a new way to review your PRs.

Read the announcement

tailwindlabs / tailwindcss

A utility-first CSS framework for rapid UI development.

View on GitHub

19 documents · Updated Nov 20, 2026

overview

Knowledge Base updated: 2026-11-19

Tailwind CSS knowledge base

Tailwind CSS is a monorepo for compiling utility-class candidates into CSS. Its core compiler parses Tailwind-aware CSS, maintains theme data, and generates utilities and variants.

The Rust Oxide scanner finds candidates in project source files; JavaScript packages expose compilation and scanning through the Node API, build-tool plugins, command-line tools, and browser runtime.

Critical compilation state lives in the core package's theme, candidate, utility, and variant models. Integration layers cache compiler/scanner state and track source and stylesheet dependencies for incremental rebuilds.

flowchart TD
  CSS[CSS input] --> Core[tailwindcss core compiler]
  Content[Project source files] --> Oxide[Oxide scanner]
  Oxide --> Core
  Core --> CSSOut[Generated CSS]
  Core --> NodeAPI[Node API]
  NodeAPI --> Vite[Vite plugin]
  NodeAPI --> PostCSS[PostCSS plugin]
  NodeAPI --> Bundlers[Webpack / Turbopack]
  NodeAPI --> CLI[CLI]
  Core --> Browser[Browser runtime]
  CLI --> Standalone[Standalone package]
  Upgrade[Upgrade tool] --> CSS
  Upgrade --> Content

Glossary

  • Candidate — a recognized class-like token that the compiler interprets as a utility plus optional variants.
  • Theme namespace — the token namespace that associates CSS custom properties with utility value families.
  • Oxide — Tailwind's Rust-based source scanner and candidate extractor.
  • Variant — a transformation that wraps or modifies a generated utility rule for a condition, selector, or at-rule.
  • Source root — the filesystem boundary and glob configuration used to select files for scanning.

Invariants

  • Theme tokens must remain consumable by utility generation; the relationship is implemented across packages/…/theme.ts and packages/…/utilities.ts.
  • Candidate parsing and variant application must produce deterministic rule ordering; see packages/…/candidate.ts and packages/…/compile.ts.
  • Scanner results must be representable through the Node-facing scanner API; see crates/oxide/** and packages/@tailwindcss-node/src/**.
  • Build integrations reuse shared compilation and dependency-tracking services rather than implementing independent compilers; see packages/@tailwindcss-node/src/** and packages/@tailwindcss-vite/src/**.
  • Tailwind-specific CSS directives are interpreted by the core compiler before generated output is emitted; see packages/…/index.ts and packages/tailwindcss/src/**.

Routing table