tailwind-v4-shadcn

Configure Tailwind CSS v4 with shadcn/ui using CSS variables and @theme inline architecture.

2|Updated Feb 15, 2026
One-click install
npx skills add https://github.com/SkinnnyJay/simpill-utils --skill tailwind-v4-shadcn-skinnnyjay
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tailwind-v4-shadcn
Source: https://github.com/SkinnnyJay/simpill-utils/tree/main/.agents/skills/tailwind-v4-shadcn
Command: npx skills add https://github.com/SkinnnyJay/simpill-utils --skill tailwind-v4-shadcn-skinnnyjay

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires tailwindcss, @tailwindcss/vite, tw-animate-css, clsx, tailwind-merge, and includes references (resource) components.

What problem does it solve? Setting up Tailwind CSS v4 with shadcn/ui breaks easily because v4 replaced config files with CSS-first theming, and outdated v3 patterns cause build failures, missing colors, and broken dark mode. ## Core Features & Use Cases - Four-Step Theme Architecture: Enforces the mandatory pattern of root-level CSS variables, @theme inline mapping, base styles, and automatic dark mode switching. - Error Prevention: Documents 8 known failure modes including tw-animate-css import errors, @apply breaking changes, @layer base cascade issues, and @theme inline dark mode conflicts. - Migration Support: Provides v3-to-v4 migration guidance covering config deletion, plugin syntax changes, OKLCH colors, and removed default element styles. - Use Case: When initializing a new React/Vite project with shadcn/ui, follow the setup checklist to get working semantic colors (bg-primary, text-foreground) with automatic dark mode in minutes instead of debugging cryptic build errors. ## Quick Start Set up Tailwind v4 with shadcn/ui in my React Vite project following the four-step CSS variable architecture.

Frequently Asked Questions about tailwind-v4-shadcn

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up Tailwind CSS v4 with shadcn/ui in a Vite project?▼

Install tailwindcss and @tailwindcss/vite, add the tailwindcss() plugin to vite.config.ts, then run shadcn init. Set "config": "" in components.json and define your theme in src/index.css using CSS variables and @theme inline instead of tailwind.config.ts.

Why is bg-primary not working in Tailwind v4?▼

The bg-primary utility fails when the @theme inline mapping block is missing from your CSS. Tailwind v4 only generates color utilities for variables explicitly mapped in @theme inline, such as --color-primary: var(--primary).

Does Tailwind v4 still use tailwind.config.ts?▼

No, Tailwind v4 ignores tailwind.config.ts for theme configuration and uses CSS-first config with @theme directives instead. Delete the config file and set "config": "" in components.json for shadcn/ui compatibility.

How do I fix dark mode not switching with @theme inline?▼

Dark mode fails when @theme inline bakes variable values into utilities at build time in multi-theme setups. For simple light/dark toggles use a ThemeProvider that switches the .dark class; for multi-theme systems use @theme without inline.

Should I use tailwindcss-animate or tw-animate-css with Tailwind v4?▼

Use tw-animate-css for Tailwind v4 projects since tailwindcss-animate is deprecated and causes module resolution errors. Install it as a dev dependency and add @import "tw-animate-css" after the tailwindcss import in your CSS entry file.

Why does @apply fail with custom classes in Tailwind v4?▼

Tailwind v4 no longer allows @apply with classes defined in @layer base or @layer components due to native CSS layer handling. Define reusable classes with the @utility directive instead, or write plain CSS referencing variables directly.