# System map — tailwindlabs/tailwindcss

> Canonical page: https://codevetter.com/unpack/tailwindcss/system-map

# System map — tailwindlabs/tailwindcss

Scanned commit 41d9cae8e53378d16087fcf359eb785c2fd42ce4 (2026-09-08). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

The repo is a pnpm workspace (`pnpm-workspace.yaml`) orchestrated by Turborepo (`turbo.json`) layered over a Cargo workspace (`Cargo.toml`, `members = ["crates/*"]`). The compiler core lives in `packages/tailwindcss` and is pure TypeScript with no filesystem access — all IO is injected via `loadModule`/`loadStylesheet` callbacks. `@tailwindcss/node` is the Node IO adapter (enhanced-resolve + jiti + Lightning CSS), and `@tailwindcss/oxide` is the Rust scanner bridged through napi-rs. Six consumer packages (cli, postcss, vite, webpack, turbopack, browser, standalone) sit on top, and `@tailwindcss/upgrade` is a separate codemod CLI. There is no server or database; the storage layer is the filesystem plus in-memory LRU caches.
- `packages/tailwindcss/src/index.ts` exports the three public compiler entrypoints — `compile(css, opts)` (string→string), `compileAst(ast, opts)` (AST→AST, used by the PostCSS plugin), and `__unstable__loadDesignSystem` (used by IntelliSense and the upgrade tool) — plus a default export that throws a hard error if someone wires `tailwindcss` directly into PostCSS. — [packages/tailwindcss/src/index.ts#L620-L871](https://github.com/tailwindlabs/tailwindcss/blob/41d9cae8e53378d16087fcf359eb785c2fd42ce4/packages/tailwindcss/src/index.ts#L620-L871)
- The core compiler takes zero filesystem dependencies: `CompileOptions` declares `loadModule` and `loadStylesheet` callbacks that default to `throwOnLoadModule`/`throwOnLoadStylesheet`, which is what makes the same code run in Node, Bun, and the browser CDN build. — [packages/tailwindcss/src/index.ts#L253-L281](https://github.com/tailwindlabs/tailwindcss/blob/41d9cae8e53378d16087fcf359eb785c2fd42ce4/packages/tailwindcss/src/index.ts#L253-L281) [packages/@tailwindcss-browser/src/index.ts](https://github.com/tailwindlabs/tailwindcss/blob/41d9cae8e53378d16087fcf359eb785c2fd42ce4/packages/%40tailwindcss-browser/src/index.ts)
- `@tailwindcss/node` is the Node runtime boundary: it wires `enhanced-resolve` resolvers (separate `cssResolver` with `mainFields: ['style']`, `esmResolver`, and `cjsResolver` fallback), `jiti` for `.ts` plugin/config files, and `Module.registerHooks({ resolve: resolveSync })` so ESM config reloads work in watch mode. — [packages/@tailwindcss-node/src/compile.ts#L170-L260](https://github.com/tailwindlabs/tailwindcss/blob/41d9cae8e53378d16087fcf359eb785c2fd42ce4/packages/%40tailwindcss-node/src/compile.ts#L170-L260) [packages/@tailwindcss-node/src/index.ts](https://github.com/tailwindlabs/tailwindcss/blob/41d9cae8e53378d16087fcf359eb785c2fd42ce4/packages/%40tailwindcss-node/src/index.ts)
- `crates/node/src/lib.rs` is the napi-rs bridge exposing the `Scanner` class (`scan()`, `scanFiles()`, `getCandidatesWithPositions()`, and `files`/`scannedFiles`/`globs`/`normalizedSources` getters) plus the `ChangedContent`, `GlobEntry`, and `SourceEntry` object shapes consumed by every JS integration. — [crates/node/src/lib.rs](https://github.com/tailwindlabs/tailwindcss/blob/41d9cae8e53378d16087fcf359eb785c2fd42ce4/crates/node/src/lib.rs) [crates/oxide/src/scanner/mod.rs#L1-L130](https://github.com/tailwindlabs/tailwindcss/blob/41d9cae8e53378d16087fcf359eb785c2fd42ce4/crates/oxide/src/scanner/mod.rs#L1-L130)
- The Cargo workspace has four crates: `tailwindcss-oxide` (the scanner/extractor), `tailwind-oxide` (`crates/node`, the NAPI shim), `classification-macros` (a `ClassifyBytes` proc-macro deriving byte-class lookup tables for the extractor state machines), and a vendored fork of BurntSushi's `ignore` crate pinned to edition 2024. — [Cargo.toml](https://github.com/tailwindlabs/tailwindcss/blob/41d9cae8e53378d16087fcf359eb785c2fd42ce4/Cargo.toml) [crates/classification-macros/src/lib.rs#L1-L40](https://github.com/tailwindlabs/tailwindcss/blob/41d9cae8e53378d16087fcf359eb785c2fd42ce4/crates/classification-macros/src/lib.rs#L1-L40) [crates/ignore/Cargo.toml#L1-L20](https://github.com/tailwindlabs/tailwindcss/blob/41d9cae8e53378d16087fcf359eb785c2fd42ce4/crates/ignore/Cargo.toml#L1-L20) [crates/oxide/Cargo.toml](https://github.com/tailwindlabs/tailwindcss/blob/41d9cae8e53378d16087fcf359eb785c2fd42ce4/crates/oxide/Cargo.toml)
- Build is `pnpm build` → `turbo build --filter=!./playgrounds/*`, followed by a `postbuild` hook that runs `scripts/pack-packages.mjs` to `pnpm pack` every non-private workspace into `dist/*.tgz` — the integration tests then install those tarballs. — [package.json#L28-L33](https://github.com/tailwindlabs/tailwindcss/blob/41d9cae8e53378d16087fcf359eb785c2fd42ce4/package.json#L28-L33) [scripts/pack-packages.mjs](https://github.com/tailwindlabs/tailwindcss/blob/41d9cae8e53378d16087fcf359eb785c2fd42ce4/scripts/pack-packages.mjs) [integrations/utils.ts#L15-L22](https://github.com/tailwindlabs/tailwindcss/blob/41d9cae8e53378d16087fcf359eb785c2fd42ce4/integrations/utils.ts#L15-L22)
- Test commands are split three ways: `pnpm test` runs `cargo test && vitest run`, `pnpm test:integrations` runs `vitest --root=./integrations`, and `pnpm test:ui` runs Playwright in both `tailwindcss` and `@tailwindcss/browser`. — [package.json#L34-L40](https://github.com/tailwindlabs/tailwindcss/blob/41d9cae8e53378d16087fcf359eb785c2fd42ce4/package.json#L34-L40) [vitest.config.mts](https://github.com/tailwindlabs/tailwindcss/blob/41d9cae8e53378d16087fcf359eb785c2fd42ce4/vitest.config.mts) [integrations/vitest.config.mts](https://github.com/tailwindlabs/tailwindcss/blob/41d9cae8e53378d16087fcf359eb785c2fd42ce4/integrations/vitest.config.mts)
- `turbo.json` gives `@tailwindcss/oxide#build` explicit `inputs` covering `../oxide/src/**/*` and `../Cargo.toml`, so touching Rust source correctly busts the Turbo cache for the native addon; it also passes `RUSTUP_HOME` through via `globalPassThroughEnv`. — [turbo.json](https://github.com/tailwindlabs/tailwindcss/blob/41d9cae8e53378d16087fcf359eb785c2fd42ce4/turbo.json)
- Deployment shape is npm publishing with provenance: `@tailwindcss/oxide` fans out into 12 platform-specific optionalDependencies (`napi.targets` includes `wasm32-wasip1-threads`), and `.github/workflows/release.yml` builds each target in a matrix then publishes with `id-token: write` for npm trusted publishing. — [crates/node/package.json](https://github.com/tailwindlabs/tailwindcss/blob/41d9cae8e53378d16087fcf359eb785c2fd42ce4/crates/node/package.json) [.github/workflows/release.yml#L30-L80](https://github.com/tailwindlabs/tailwindcss/blob/41d9cae8e53378d16087fcf359eb785c2fd42ce4/.github/workflows/release.yml#L30-L80) [.github/workflows/release.yml#L205-L235](https://github.com/tailwindlabs/tailwindcss/blob/41d9cae8e53378d16087fcf359eb785c2fd42ce4/.github/workflows/release.yml#L205-L235)
- `@tailwindcss/standalone` is built by Bun (`bun ./scripts/build.ts`) into seven single-file executables (linux/macos/windows × arm64/x64, glibc and musl), each SHA-256 checksummed; it is marked `private: true` so `pack-packages.mjs` skips it. — [packages/@tailwindcss-standalone/package.json](https://github.com/tailwindlabs/tailwindcss/blob/41d9cae8e53378d16087fcf359eb785c2fd42ce4/packages/%40tailwindcss-standalone/package.json) [packages/@tailwindcss-standalone/scripts/build.ts#L23-L100](https://github.com/tailwindlabs/tailwindcss/blob/41d9cae8e53378d16087fcf359eb785c2fd42ce4/packages/%40tailwindcss-standalone/scripts/build.ts#L23-L100)
- Lightning CSS is the only output post-processor: `optimize()` in `@tailwindcss/node` runs `transform()` twice (so nesting-flattened adjacent rules get merged), pins browser targets to Safari/iOS 16.4, Firefox 128, Chrome 111, and uses `errorRecovery: true` with a warning filter for framework pseudo-classes like `::ng-deep` and `::v-deep`. — [packages/@tailwindcss-node/src/optimize.ts#L28-L90](https://github.com/tailwindlabs/tailwindcss/blob/41d9cae8e53378d16087fcf359eb785c2fd42ce4/packages/%40tailwindcss-node/src/optimize.ts#L28-L90)
- pnpm patches three dependencies — `@napi-rs/cli`, `@parcel/watcher`, and `lightningcss` — specifically so Bun can statically analyze them when compiling the standalone binary. — [pnpm-workspace.yaml#L8-L12](https://github.com/tailwindlabs/tailwindcss/blob/41d9cae8e53378d16087fcf359eb785c2fd42ce4/pnpm-workspace.yaml#L8-L12) [packages/@tailwindcss-standalone/package.json](https://github.com/tailwindlabs/tailwindcss/blob/41d9cae8e53378d16087fcf359eb785c2fd42ce4/packages/%40tailwindcss-standalone/package.json)
- `playgrounds/` holds three manual smoke-test apps (vite + React, nextjs, v3) wired via root scripts `pnpm vite` and `pnpm nextjs`; the Vite one is a two-line config registering `@tailwindcss/vite` alongside `@vitejs/plugin-react`. — [playgrounds/vite/vite.config.ts](https://github.com/tailwindlabs/tailwindcss/blob/41d9cae8e53378d16087fcf359eb785c2fd42ce4/playgrounds/vite/vite.config.ts) [package.json#L41-L43](https://github.com/tailwindlabs/tailwindcss/blob/41d9cae8e53378d16087fcf359eb785c2fd42ce4/package.json#L41-L43) [.github/CONTRIBUTING.md#L30-L37](https://github.com/tailwindlabs/tailwindcss/blob/41d9cae8e53378d16087fcf359eb785c2fd42ce4/.github/CONTRIBUTING.md#L30-L37)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
