tailwind-v4-shadcn

Configure Tailwind CSS v4 with shadcn/ui, Vite, and React including dark mode theming.

1|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/TierOne-Studio/spa-velocity --skill tailwind-v4-shadcn-tierone-studio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tailwind-v4-shadcn
Source: https://github.com/TierOne-Studio/spa-velocity/tree/main/.ruler/skills/tailwind-v4-shadcn
Command: npx skills add https://github.com/TierOne-Studio/spa-velocity --skill tailwind-v4-shadcn-tierone-studio

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Setting up Tailwind CSS v4 with shadcn/ui breaks easily because v4 changed the configuration model: no tailwind.config.ts, CSS-first @theme inline mapping, and new @plugin directives. This Skill provides production-tested patterns that prevent common build failures, broken colors, and non-switching dark mode. ## Core Features & Use Cases - Four-Step CSS Architecture: Defines CSS variables at root level, maps them via @theme inline, applies base styles, and gets automatic dark mode without dark: variants. - Dark Mode Implementation: Provides a ThemeProvider with localStorage persistence, system theme detection, and a shadcn/ui dropdown toggle component. - Troubleshooting & Migration: Documents 18 known gotchas (tw-animate-css errors, duplicate @layer base, double hsl() wrapping) plus a v3-to-v4 migration guide and official plugin setup for Typography and Forms. - Use Case: A developer scaffolding a new Vite + React 19 project copies the provided index.css, vite.config.ts, components.json, and theme-provider.tsx templates to get a working themed UI in minutes without debugging CSS variable issues. ## Quick Start Ask the AI to set up Tailwind v4 with shadcn/ui in your Vite React project using this skill's four-step architecture and templates.

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 Vite?

Install tailwindcss and @tailwindcss/vite, add the tailwindcss() plugin to vite.config.ts, run shadcn init, set "config": "" in components.json, and delete tailwind.config.ts. Define colors as CSS variables in :root and map them with @theme inline.

How to implement dark mode in Tailwind v4 with React?

Create a ThemeProvider component that toggles a .dark class on the html element and persists the choice to localStorage. Define dark color overrides in a .dark CSS block; semantic utilities like bg-primary then switch automatically without dark: variants.

Why is bg-primary not working in Tailwind v4?

The utility class doesn't exist because the CSS variable was never mapped to Tailwind's theme. Add an @theme inline block that maps each variable, for example --color-primary: var(--primary), which generates the bg-primary utility.

Does Tailwind v4 still use tailwind.config.ts?

No. Tailwind v4 ignores theme.extend.colors in tailwind.config.ts and uses CSS-first configuration instead. Delete the file and set "tailwind": { "config": "" } in components.json so shadcn/ui generates v4-compatible styles.

How do I add the Typography plugin in Tailwind v4?

Install @tailwindcss/typography, then load it in your CSS with the @plugin directive: @plugin "@tailwindcss/typography" after @import "tailwindcss". Using @import or the v3 config file plugins array will fail in v4.

Why do my Tailwind v4 colors show as black or white?

This usually comes from double hsl() wrapping, such as background-color: hsl(var(--background)) when the variable already contains hsl(). Reference variables directly with var(--background) in @layer base to fix it.