tailwind-v4-shadcn

Configure Tailwind CSS v4 and shadcn/ui for Vite+React projects.

1|Updated Mar 15, 2026
One-click install
npx skills add https://github.com/kennyolofsson23-netizen/claude-code-config --skill tailwind-v4-shadcn-kennyolofsson23-netizen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tailwind-v4-shadcn
Source: https://github.com/kennyolofsson23-netizen/claude-code-config/tree/main/skills/tailwind-v4-shadcn
Command: npx skills add https://github.com/kennyolofsson23-netizen/claude-code-config --skill tailwind-v4-shadcn-kennyolofsson23-netizen

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Provides a production-tested, deterministic setup for Tailwind CSS v4 with shadcn/ui that prevents common theming, build, and dark-mode failures and dramatically reduces setup and debugging time.

Core Features & Use Cases

  • Reliable theming architecture: Enforces root-level CSS variables, hsl() wrappers, @theme inline mappings, and a single @layer base to avoid double-wrapping and duplicate layers.
  • Dark mode & ThemeProvider patterns: Supplies ThemeProvider and toggle patterns that persist user preferences and avoid flash-of-unstyled-theme issues.
  • Migration & plugin guidance: Includes migration steps from Tailwind v3, plugin usage with @plugin, and templates for vite.config, components.json, and index.css to ensure builds succeed.
  • Use Case: Initialize a Vite + React + TypeScript project and migrate an existing Tailwind v3 codebase to v4 with automatic semantic color tokens and robust dark-mode support.

Quick Start

Use the tailwind-v4-shadcn skill to configure a Vite+React project for Tailwind v4 with shadcn/ui and automatic dark mode support.

Frequently Asked Questions about tailwind-v4-shadcn

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

FAQPage Schema
How do I migrate from Tailwind CSS v3 to v4 with shadcn/ui in a Vite React project?

To migrate from Tailwind v3 to v4, remove tailwind.config.ts, update components.json to use an empty config, apply the Vite tailwind plugin, and remap semantic color tokens using @theme inline mappings in your index.css.

Why does my Tailwind v4 dark mode theme switching not work with shadcn/ui?

Tailwind v4 dark mode issues often stem from missing .dark overrides or incorrect CSS variable definitions. Define root-level hsl() wrappers and use a ThemeProvider to persist preferences and prevent flash-of-unstyled-theme errors.

How do I configure CSS variables for theming in Tailwind v4 and shadcn/ui?

Configure CSS variables by defining them at the root level with hsl() wrappers, mapping them through @theme inline, and applying a single @layer base to avoid double-wrapping and duplicate layer conflicts.

Do I need to remove tailwind.config.ts when setting up Tailwind v4 with shadcn/ui?

Yes, you must remove tailwind.config.ts for production compatibility. Tailwind v4 uses the Vite plugin and components.json with an empty tailwind config instead of the traditional configuration file.

What is the best way to set up a Vite React TypeScript project with Tailwind v4 and shadcn/ui?

The best setup uses the Vite tailwind plugin, removes tailwind.config.ts, configures components.json, and establishes root-level CSS variables with @theme inline mappings for reliable theming architecture and dark mode support.

Can I use Tailwind CSS v4 with shadcn/ui to prevent flash-of-unstyled-theme issues?

Yes, by implementing a ThemeProvider pattern with proper root-level CSS variables and .dark overrides, you can persist user preferences and avoid flash-of-unstyled-theme issues during dark mode initialization.