Use when a Tailwind build completes successfully but the compiled CSS is empty, partial, or stale, when classes appear in markup but styles never render in the browser, when a freshly added utility refuses to take effect, when an HMR update leaves the page styled with the previous build, or when a monorepo package's components ship un-styled because the scanner does not look at their files. Prevents the dynamic-class-name trap (string interpolation breaks detection in BOTH v3 content scanner and v4 Oxide scanner, the most common reason for "Tailwind is broken"), the too-narrow content glob (v3 content array misses new directories), the cached-build trap (Vite's node_modules/.vite cache + Next.js .next cache hold stale class output), the Turbopack arbitrary-value miss (Next.js 16.x + Turbopack incremental build misses aspect-[12/5], z-[100]), the Astro v4.0.8 regression (pin to v4.0.7), the monorepo-import trap (importing a UI lib from node_modules whose classes the scanner never sees), and the v3-v4 directive
Standardmäßig ist der Prompt ausgewählt, der zuerst die Quelle prüft. Sie können zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.
Quelldateien prüfen
Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich für eine Installation entscheiden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
Use when a Tailwind build completes successfully but the compiled CSS is empty, partial, or stale, when classes appear in markup but styles never render in the browser, when a freshly added utility refuses to take effect, when an HMR update leaves the page styled with the previous build, or when a monorepo package's components ship un-styled because the scanner does not look at their files. Prevents the dynamic-class-name trap (string interpolation breaks detection in BOTH v3 content scanner and v4 Oxide scanner, the most common reason for "Tailwind is broken"), the too-narrow content glob (v3 content array misses new directories), the cached-build trap (Vite's node_modules/.vite cache + Next.js .next cache hold stale class output), the Turbopack arbitrary-value miss (Next.js 16.x + Turbopack incremental build misses aspect-[12/5], z-[100]), the Astro v4.0.8 regression (pin to v4.0.7), the monorepo-import trap (importing a UI lib from node_modules whose classes the scanner never sees), and the v3-v4 directive-mix trap (using @tailwind base in v4 OR @import "tailwindcss" in v3 yields empty output). Covers v3 content array + safelist + blocklist + transform + extract, v4 auto-detect + @source + @source not + @source inline + @source none, brace-expansion safelist syntax, monorepo absolute-path patterns, Vite cache invalidation (rm -rf node_modules/.vite), Next.js cache invalidation (rm -rf .next), Turbopack workarounds, Astro version pinning, watch-mode-misses-new-directory restart procedure, and the static-class-name discipline that prevents 90% of all build failures. Keywords: tailwind build fails, no utility classes generated, empty output css, tailwind classes not applied, styles missing in build, jit not detecting class, content not scanned, @source not working, v4 source detection, v3 content array, safelist, blocklist, dynamic class names, string interpolation tailwind, monorepo tailwind, ui library not styled, node_modules tailwind, vite cache stale, node_modules/.vite, next cache, .next cache, turbopack arbitrary value, aspect-[12/5] not generated, z-[100] missing, next.js 16 turbopack, astro 4.0.8 broken, tailwind 4.0.7 pin, @tailwindcss/vite regression, @import tailwindcss missing utilities, watch mode not detecting new file, why is my tailwind class missing, my class is in html but no style, my padding class disappeared, tailwind not rebuilding, hot reload broken tailwind, brace expansion safelist, bg-red-{50,100,200,300}, force generate tailwind class, arbitrary values jit, monorepo @source absolute path, restart tailwind watcher
license
MIT
compatibility
Designed for Claude Code. Requires Tailwind CSS v3.4 or v4.0+.
metadata
{"author":"OpenAEC-Foundation","version":"1.0"}
Tailwind Build Failures : Why Your Classes Don't Render
The Tailwind compiler emits ONLY the utility classes it can DETECT in
your source files. Every "Tailwind is broken" report is one of :
The compiler did not see the file containing the class.
The compiler saw the file but could not parse the class as a
complete unbroken string.
The class was detected, compiled, but a stale build cache served
yesterday's CSS to the browser.
A version-specific regression in v4 or Turbopack swallowed certain
class patterns silently.
This skill is the diagnostic flow for all four. Always go top to
bottom : root-cause-first.
Companion skills :
tailwind-impl-config-v3 : the content array surface
tailwind-impl-config-v4 : the @source directive surface
tailwind-errors-runtime : when classes ARE in CSS but not applied
tailwind-errors-v4-migration : v3-to-v4 specific breakage
Quick Reference : 60-Second Diagnostic
1. Inspect compiled CSS (open the file the browser loads).
- File is EMPTY -> scanner found nothing
- File has SOME classes, missing X -> X was not detected
- File looks right but browser shows old styles -> cache stale
- File is missing a recently added class -> watcher missed it
2. Search compiled CSS for the missing class :
grep "p-4" dist/output.css
3. If absent : the SCANNER missed it. Go to "Scanner Diagnosis".
If present : the BUILD is stale OR another rule wins. Go to
"Cache Diagnosis" + tailwind-errors-runtime.
Decision Tree : Scanner Missed the Class
Is the class an UNBROKEN STRING in source ?
├── NO (string interpolation: `bg-${color}-500`)
│ -> FIX: replace with static lookup (see "Static-Class Discipline")
│
└── YES
├── v3 : Is the file inside `content` globs ?
│ ├── NO -> add the glob OR widen existing one
│ └── YES -> check next branch
│
└── v4 : Is the file inside auto-detect scope OR explicit @source ?
├── NO (file in node_modules, monorepo sibling, etc.)
│ -> Add @source "../path/to/file"
└── YES
├── Turbopack ? -> see "Turbopack Workaround"
├── Astro v4.0.8 ? -> pin to v4.0.7
└── Otherwise -> restart watcher (new-directory case)
Decision Tree : Stale Cache
Did the class appear in CSS yesterday but not today after a code change ?
Vite project ?
-> rm -rf node_modules/.vite ; npm run dev
Next.js project ?
-> rm -rf .next ; npm run dev
Webpack project ?
-> Disable persistent cache OR rm -rf node_modules/.cache
Astro project ?
-> rm -rf .astro dist node_modules/.vite ; npm run dev
CLI watch mode ?
-> Ctrl-C, restart npx (@tailwindcss/cli OR tailwindcss)
CRITICAL : Static-Class Discipline
90% of "Tailwind is broken" reports trace to ONE pattern.
The {n..m..step} range is a v4 feature. Pre-generates the entire
palette for dynamic class needs.
CRITICAL : Stale Build Cache
Tailwind itself is fast and deterministic. The host bundler's cache
is what goes stale.
Vite + Tailwind v4
The Vite dependency-cache lives in node_modules/.vite. When you
edit tailwind.config.js or app.css, Vite sometimes serves cached
PostCSS output. Symptom : you delete bg-red-500 from source, it
still appears in the browser.
rm -rf node_modules/.vite
npm run dev
Next.js (App Router + Pages Router)
Next.js caches PostCSS output in .next/. After upgrading Tailwind
or switching v3-v4, force a fresh build :
rm -rf .next
npm run dev
Astro
Astro layers its own .astro cache on top of Vite's .vite cache :
rm -rf .astro dist node_modules/.vite
npm run dev
Standalone CLI watch
Kill the watcher (Ctrl-C) and restart. The watcher's chokidar (v3) or
Oxide (v4) caches file lists at startup ; new-directory additions
need a restart.
Known Version-Specific Regressions
Turbopack arbitrary-value miss (Next.js 16.x + Tailwind v4.2.1)
Per issue 19825 : aspect-[12/5], z-[100], and similar arbitrary-value
classes are emitted in markup but NEVER reach compiled CSS when using
Next.js 16.1.6 with --turbo. Affects files that import certain
third-party libraries (e.g. Swiper.js).
Workarounds :
# Option 1 : disable Turbopack (use Webpack)
next dev # no --turbo
// Option 2 : inline style instead of arbitrary value
<div style={{ aspectRatio: "12/5" }}>
<divstyle={{zIndex:100 }}>
// Option 3 : add the arbitrary class to @source inline so it// is always generated regardless of detection
@source inline("aspect-[12/5] z-[100]");
Astro v4.0.8 regression (issue 16733)
Per issue 16733 : Tailwind v4.0.8 with @tailwindcss/vite v4.0.8 and
Astro v5.3.0 silently drops styles from imported component packages.
Workaround : pin to v4.0.7 until upstream resolves.
Detection : if the compiled CSS is <2 KB, the directive line is
probably wrong.
CRITICAL : Watcher Misses New Directory
# v3mkdir src/admin
# Watcher does NOT pick up files in src/admin if content glob is# ./src/components/**/* rather than ./src/**/*# v4mkdir packages/widget
# Auto-detect picks it up if it's in cwd ; if it's a sibling outside# cwd, ADD @source "../widget".
Fix : restart watcher AND widen content/@source scope.
What This Skill Does NOT Cover
Classes ARE in CSS but browser shows wrong styles -> see
tailwind-errors-runtime (specificity, cascade, scope).
v3-to-v4 migration breakage -> see tailwind-errors-v4-migration.
Forms / plugin classes missing -> see
tailwind-impl-plugins-official § "Verifying a Plugin Loaded".
cn/twMerge returns unexpected output -> see
tailwind-impl-tailwind-merge.
HMR not updating React state (not a Tailwind issue) -> see the
bundler's docs.
References
references/methods.md : every config option, every directive,
every cache-invalidation command.
references/examples.md : full diagnostic walk-throughs for the
classic failure modes.
references/anti-patterns.md : the traps catalogued by symptom.