tailwind-v4-shadcn

Configure Tailwind v4 with shadcn/ui theming via CSS variables in React and Vite projects.

1|Updated Nov 27, 2022
One-click install
npx skills add https://github.com/gonzalopozo/gonzalopozo.github.io --skill tailwind-v4-shadcn-gonzalopozo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tailwind-v4-shadcn
Source: https://github.com/gonzalopozo/gonzalopozo.github.io/tree/main/.agents/skills/tailwind-v4-shadcn
Command: npx skills add https://github.com/gonzalopozo/gonzalopozo.github.io --skill tailwind-v4-shadcn-gonzalopozo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This setup enables a cohesive, scalable theming approach for Tailwind v4 with shadcn/ui, replacing hardcoded color tokens with semantic CSS variables and ensuring consistent dark mode behavior.

Core Features & Use Cases

  • Four-step architecture: Define root CSS variables, map to utilities with @theme inline, apply base styles, and rely on automatic dark mode.
  • Robust integration: Works in React + Vite projects, with zero-tailwind.config.ts, and a ThemeProvider to toggle light/dark/system themes.
  • Migration-ready guidance: Includes steps to migrate from v3 patterns, common gotchas, and a structure to validate builds.

Quick Start

Follow the exact steps to install Tailwind v4 with shadcn/ui, initialize with empty tailwind.config.ts, and wrap your app with a ThemeProvider to enable proper theming.

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 v4 with shadcn/ui theming in a React and Vite project?

To set up Tailwind v4 with shadcn/ui theming, you define root CSS variables, map them to utilities using @theme inline, apply base styles, and rely on automatic dark mode. This approach enforces a CSS-first configuration with zero tailwind.config.ts usage in React and Vite projects.

What is the best way to enable automatic dark mode with shadcn/ui and Tailwind v4?

The best way to enable automatic dark mode is by replacing hardcoded color tokens with semantic CSS variables. Using a CSS-variable architecture with @theme inline mappings ensures consistent dark mode behavior without relying on v3-era tailwind.config.ts configurations.

Do I need to remove tailwind.config.ts when migrating shadcn/ui theming to Tailwind v4?

Yes, you must remove tailwind.config.ts to enforce a CSS-first configuration in Tailwind v4. The setup relies entirely on CSS variables and @theme inline mappings, providing migration-ready guidance to shift away from v3 patterns and avoid common gotchas.

How does the ThemeProvider integration work for persistent user themes in Tailwind v4?

The ThemeProvider integration wraps your React application to toggle light, dark, and system themes. It ensures persistent user themes and respects system preferences by leveraging the semantic CSS variables defined in your root styles.

Why are my semantic color tokens not working after migrating shadcn/ui to Tailwind v4?

Semantic color tokens fail when v3-era configurations are still active. To fix this, initialize an empty tailwind.config.ts, define root CSS variables, and ensure your @theme inline mappings correctly apply base styles for automatic dark mode.