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/**andpackages/@tailwindcss-node/src/**. - Build integrations reuse shared compilation and dependency-tracking services rather than implementing independent compilers; see
packages/@tailwindcss-node/src/**andpackages/@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
- packages/…/index.ts -> Compiler and CSS generation
- packages/…/compile.ts -> Compiler and CSS generation
- packages/…/at-import.ts -> CSS directives and parsing
- packages/…/index.ts -> CSS directives and parsing
- packages/…/theme.ts -> Theme and design tokens
- packages/…/utilities.ts -> Theme and design tokens
- packages/…/candidate.ts -> Utility and variant compilation
- packages/…/utilities.ts -> Utility and variant compilation
- packages/…/variants.ts -> Utility and variant compilation
crates/oxide/**-> Content discovery and scanningpackages/@tailwindcss-node/src/**-> Content discovery and scanningcrates/oxide/src/**-> Oxide scanner and native bindingscrates/node/**-> Oxide scanner and native bindings- packages/…/compile.ts -> Source resolution and globbing
- crates/…/glob.rs -> Source resolution and globbing
packages/@tailwindcss-node/src/**-> Build tool integrationspackages/@tailwindcss-vite/src/**-> Build tool integrations- packages/…/index.ts -> Node API and compilation services
- packages/…/compile.ts -> Node API and compilation services
packages/@tailwindcss-vite/src/**-> Vite pluginpackages/@tailwindcss-postcss/src/**-> PostCSS pluginpackages/@tailwindcss-webpack/src/**-> Webpack and Turbopack adapterspackages/@tailwindcss-turbopack/src/**-> Webpack and Turbopack adapterspackages/@tailwindcss-cli/src/**-> Developer toolspackages/@tailwindcss-upgrade/src/**-> Developer tools- packages/…/index.ts -> CLI build workflow
packages/@tailwindcss-cli/src/commands/**-> CLI build workflowpackages/@tailwindcss-upgrade/src/**-> Upgrade tool transformationspackages/@tailwindcss-browser/src/**-> Runtime deliverypackages/@tailwindcss-standalone/src/**-> Runtime deliverypackages/@tailwindcss-browser/src/**-> Browser runtimepackages/@tailwindcss-standalone/src/**-> Standalone packagingpackages/@tailwindcss-standalone/**-> Standalone packaging