Enforce Tailwind v4 + CSS Variables
Key Files
- •
src/index.css— CSS variable definitions (--toxic-green,--void-black, etc.) - •
src/ui/— primary location for UI components using Tailwind classes - •
src/components/— game components that may use Tailwind - •
src/scenes/— scene components with styled markup
Correct Syntax Examples
| Wrong (v3 / hardcoded) | Correct (v4) |
|---|---|
bg-[var(--void-black)] | bg-(--void-black) |
text-[var(--toxic-green)] | text-(--toxic-green) |
bg-gray-900 | bg-(--void-black) |
#00ff00 | var(--toxic-green) |
@tailwind base | @import "tailwindcss" |
Workflow
- •Scan
src/for hardcoded colors: hex (#xxx),rgb(),hsl(), Tailwind palette classes (bg-gray-*,text-red-*). - •Scan for Tailwind v3-style CSS variable usage:
bg-[var(--...)]bracket syntax. - •Check
src/index.cssfor the authoritative list of CSS variables. - •Replace violations with v4 variable syntax using the examples above.
Command
- •Prefer the bundled script:
./.agents/skills/tailwind-v4-css-variables-enforcer/scripts/audit-tailwind-v4.sh
Output
- •Report any matches with file paths and line numbers.
- •Suggest compliant replacements using project CSS variables.
Related Skills
- •
convention-keeper-brutalist-ui— broader UI convention enforcement - •
dependency-pin-upgrade-blocker— ensures Tailwind stays at v4