Tailwind v4 with shadcn/ui using CSS variables and @theme inline pattern.
Works with
Four-step architecture: define CSS variables at root, map to Tailwind utilities with @theme inline , apply base styles, automatic dark mode switching
Prevents 8 documented errors including color mapping failures, dark mode conflicts, @apply breaking changes, and v3 migration gotchas
Requires @tailwindcss/vite plugin (not PostCSS), empty Tailwind config in components.json, and ThemeProvider wrapper for theme tog
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versiontailwind-v4-shadcnExecute the skills CLI command in your project's root directory to begin installation:
Fetches tailwind-v4-shadcn from jezweb/claude-skills and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate tailwind-v4-shadcn. Access via /tailwind-v4-shadcn in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
0
total installs
0
this week
697
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
697
stars
Production-tested: WordPress Auditor (https://wordpress-auditor.webfonts.workers.dev) Last Updated: 2026-01-20 Versions: [email protected], @tailwindcss/[email protected] Status: Production Ready ✅
# 1. Install dependencies
pnpm add tailwindcss @tailwindcss/vite
pnpm add -D @types/node tw-animate-css
pnpm dlx shadcn@latest init
# 2. Delete v3 config if exists
rm tailwind.config.ts # v4 doesn't use this file
vite.config.ts:
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
import path from 'path'
export default defineConfig({
plugins: [react(), tailwindcss()],
resolve: { alias: { '@': path.resolve(__dirname, './src') } }
})
components.json (CRITICAL):
{
"tailwind": {
"config": "", // ← Empty for v4
"css": "src/index.css",
"baseColor": "slate",
"cssVariables": true
}
}
Skipping steps will break your theme. Follow exactly:
/* src/index.css */
@import "tailwindcss";
@import "tw-animate-css"; /* Required for shadcn/ui animations */
:root {
--background: hsl(0 0% 100%); /* ← hsl() wrapper required */
--foreground: hsl(222.2 84% 4.9%);
--primary: hsl(221.2 83.2% 53.3%);
/* ... all light mode colors */
}
.dark {
--background: hsl(222.2 84% 4.9%);
--foreground: hsl(210 40% 98%);
--primary: hsl(217.2 91.2% 59.8%);
/* ... all dark mode colors */
}
Critical: Define at root level (NOT inside @layer base). Use hsl() wrapper.
@theme inline {
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-primary: var(--primary);
/* ... map ALL CSS variables */
}
Why: Generates utility classes (bg-background, text-primary). Without this, utilities won't exist.
@layer base {
body {
background-color: var(--background); /* NO hsl() wrapper here */
color: var(--foreground);
}
}
Critical: Reference variables directly. Never double-wrap: hsl(var(--background)).
<div className="bg-background text-foreground">
{/* No dark: variants needed - theme switches automatically */}
</div>
1. Create ThemeProvider (see templates/theme-provider.tsx)
2. Wrap App:
// src/main.tsx
import { ThemeProvider } from '@/components/theme-provider'
ReactDOM.createRoot(document.getElementById('root')!).render(
<ThemeProvider defaultTheme="dark" storageKey="vite-ui-theme">
<App />
</ThemeProvider>
)
3. Add Theme Toggle:
pnpm dlx shadcn@latest add dropdown-menu
See reference/dark-mode.md for ModeToggle component.
hsl() in :root/.dark: --bg: hsl(0 0% 100%);@theme inline to map all CSS variables"tailwind.config": "" in components.jsontailwind.config.ts if exists@tailwindcss/vite plugin (NOT PostCSS):root/.dark inside @layer base (causes cascade issues).dark { @theme { } } pattern (v4 doesn't support nested @theme)hsl(var(--background))tailwind.config.ts for theme (v4 ignores it)@apply directive (deprecated in v4, see error #7)dark: variants for semantic colors (auto-handled)@apply with @layer base or @layer components classes (v4 breaking change - use @utility instead) | Source@layer base without understanding CSS layer ordering (see error #8) | SourceThis skill prevents 8 documented errors.
Error: "Cannot find module 'tailwindcss-animate'"
Cause: shadcn/ui deprecated tailwindcss-animate for v4.
Solution:
# ✅ DO
pnpm add -D tw-animate-css
# Add to src/index.css:
@import "tailwindcss";
@import "tw-animate-css";
# ❌ DON'T
npm install tailwindcss-animate # v3 only
Error: bg-primary doesn't apply styles
Cause: Missing @theme inline mapping
Solution:
@theme inline {
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-primary: var(--primary);
/* ... map ALL CSS variables */
}
Error: Theme stays light/dark
Cause: Missing ThemeProvider
Solution:
templates/theme-provider.tsx)main.tsx.dark class toggles on <html> elementError: "Duplicate @layer base" in console
Cause: shadcn init adds @layer base - don't add another
Solution:
/* ✅ Correct - single @layer base */
@import "tailwindcss";
:root { --background: hsl(0 0% 100%); }
@theme inline { --color-background: var(--background); }
@layer base { body { background-color: var(--background); } }
Error: "Unexpected config file"
Cause: v4 doesn't use tailwind.config.ts (v3 legacy)
Solution:
rm tailwind.config.ts
v4 configuration happens in src/index.css using @theme directive.
Error: Dark mode doesn't switch when using @theme inline with custom variants (e.g., data-mode="dark")
Source:
Prerequisites
Time Estimate
15-45 minutes depending on use case complexity
Steps
Common Pitfalls
✓ Do
✗ Don't
💡 Pro Tips
✓ Use when
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid when
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
jezweb/claude-skills
anthropics/claude-code
mblode/agent-skills
github/awesome-copilot
sickn33/antigravity-awesome-skills
leonxlnx/taste-skill
I recommend tailwind-v4-shadcn for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
Useful defaults in tailwind-v4-shadcn — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
We added tailwind-v4-shadcn from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
Solid pick for teams standardizing on skills: tailwind-v4-shadcn is focused, and the summary matches what you get after install.
tailwind-v4-shadcn has been reliable in day-to-day use. Documentation quality is above average for community skills.
tailwind-v4-shadcn is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
tailwind-v4-shadcn fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
tailwind-v4-shadcn has been reliable in day-to-day use. Documentation quality is above average for community skills.
tailwind-v4-shadcn fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
tailwind-v4-shadcn reduced setup friction for our internal harness; good balance of opinion and flexibility.
showing 1-10 of 42