Production-tested setup for Tailwind CSS v4 with shadcn/ui, Vite, and React. Use when: initializing React projects with Tailwind v4, setting up shadcn/ui, implementing dark mode, debugging CSS variable issues, fixing theme switching, migrating from Tailwind v3, or encountering color/theming problems. Covers: @theme inline pattern, CSS variable architecture, dark mode with ThemeProvider, component composition, vite.config setup, common v4 gotchas, and production-tested patterns. Keywords: Tailwind v4, shadcn/ui, @tailwindcss/vite, @theme inline, dark mode, CSS variables, hsl() wrapper, components.json, React theming, theme switching, colors not working, variables broken, theme not applying, @plugin directive, typography plugin, forms plugin, prose class, @tailwindcss/typography, @tailwindcss/forms
Status: Production Ready ✅ Last Updated: 2025-10-29 Production Tested: WordPress Auditor (https://wordpress-auditor.webfonts.workers.dev)
This skill should be invoked when user mentions ANY of:
tailwind v4tailwind css v4shadcn/uishadcn uivite + react + tailwind@tailwindcss/vitedark mode setuptheme providertheme switching@theme inlinecss variables not workingcolors not applyingtailwind utilities missingtw-animate-css (common error)@apply deprecateddark: variant not workingcolors all black/whitebg-primary doesn't work@import typography (wrong v4 syntax)require @tailwindcss/typography (v3 syntax in v4)prose class not working@plugin directiveSets up production-ready Vite + React + Tailwind CSS v4 + shadcn/ui with:
✅ Correct v4 architecture - @theme inline pattern, no config file ✅ Dark mode - ThemeProvider with system/light/dark support ✅ Error prevention - Fixes tw-animate-css, duplicate @layer, @apply deprecation ✅ Semantic colors - Full color palette with proper CSS variables ✅ Path aliases - @/* imports configured ✅ TypeScript - Full type safety ✅ Templates - Proven file templates ready to copy
| Issue | Why It Happens | How Skill Fixes It |
|-------|---------------|-------------------|
| tw-animate-css import error | shadcn init adds non-existent import | Provides clean CSS template |
| Duplicate @layer base | shadcn init adds second block with @apply | Single clean @layer block |
| Colors don't work | Missing @theme inline mapping | Complete mapping provided |
| Dark mode broken | No ThemeProvider or wrong setup | Full ThemeProvider template |
| Wrong config | tailwind.config.ts used for theme | Empty config, CSS-only theme |
| Double hsl() wrapping | Common pattern mistake | Correct variable usage |
| Wrong plugin syntax | Using @import or require() for plugins | Correct @plugin directive documented |
~/.claude/skills/tailwind-v4-shadcn/
├── README.md # This file - auto-trigger keywords
├── SKILL.md # Complete documentation (623 lines)
├── templates/ # Ready-to-copy file templates
│ ├── index.css # v4 CSS architecture
│ ├── components.json # shadcn/ui v4 config
│ ├── vite.config.ts # Vite + Tailwind plugin
│ ├── tsconfig.app.json # TypeScript with aliases
│ ├── theme-provider.tsx # Dark mode provider
│ └── utils.ts # cn() utility
└── reference/ # Deep-dive docs
├── architecture.md
├── dark-mode.md
├── common-gotchas.md
└── migration-guide.md
When Claude detects trigger keywords, it should:
tailwind-v4-shadcn skill. Use it?"templates/ directory| Approach | Tokens Used | Errors | |----------|------------|--------| | Manual setup (no skill) | ~65,000 | 2-3 common errors | | With this skill | ~20,000 | 0 (prevented) | | Savings | ~70% | 100% reduction |
{
"dependencies": {
"tailwindcss": "^4.1.14",
"@tailwindcss/vite": "^4.1.14",
"clsx": "^2.1.1",
"tailwind-merge": "^3.3.1",
"react": "^19.2.0",
"react-dom": "^19.2.0"
},
"devDependencies": {
"@types/node": "^24.0.0",
"@vitejs/plugin-react": "^5.0.4",
"vite": "^7.0.0",
"typescript": "~5.9.0"
}
}
User: "Set up a new Vite + React project with Tailwind v4"
↓
Claude: [Checks ~/.claude/skills/tailwind-v4-shadcn/]
↓
Claude: "I found the tailwind-v4-shadcn skill. Use it?
(Prevents tw-animate-css error, includes dark mode)"
↓
User: "Yes"
↓
Claude: [Uses templates/ + follows SKILL.md]
↓
Result: Working project in ~1 minute, 0 errors
name: tailwind-v4-shadcn
version: 1.0.0
category: frontend-setup
stack: [vite, react, tailwind-v4, shadcn-ui]
confidence: high # Production-tested pattern
auto_invoke_threshold: 0.7 # Invoke if 70%+ match
maintained_by: jeremy@jezweb.net
last_tested: 2025-10-20
react-vite-base - Vite + React without Tailwindcloudflare-react-full-stack - Adds Cloudflare Workersreact-form-zod - React Hook Form + Zod validationSKILL.md (623 lines)reference/common-gotchas.mdSearch for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer