tailwind-v4-shadcn

Configure Tailwind CSS v4 and shadcn/ui theming with CSS variables and @theme inline mappings.

885|108|Updated Apr 30, 2025
One-click install
npx skills add https://github.com/legions-developer/invoicely --skill tailwind-v4-shadcn-legions-developer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tailwind-v4-shadcn
Source: https://github.com/legions-developer/invoicely/tree/main/.agents/skills/tailwind-v4-shadcn
Command: npx skills add https://github.com/legions-developer/invoicely --skill tailwind-v4-shadcn-legions-developer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Tailwind CSS v4 theming with shadcn/ui often breaks due to incorrect CSS variable placement, missing @theme inline mappings, or misconfigured dark mode behavior, leading to “colors not working” and theme-switch failures.

Core Features & Use Cases

  • Production-tested Tailwind v4 + shadcn/ui architecture that prevents common v4 setup failures.
  • CSS-variable + @theme inline semantic color system for consistent utilities like bg-background/text-foreground across light and dark themes.
  • Guardrails for dark mode + ThemeProvider wiring, ensuring theme switching works reliably.
  • Targeted use cases: initializing React projects with Tailwind v4, setting up shadcn/ui, migrating from Tailwind v3, and debugging theme/color issues.

Quick Start

I'm setting up Tailwind v4 + shadcn/ui - check the tailwind-v4-shadcn skill first.

Frequently Asked Questions about tailwind-v4-shadcn

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

FAQPage Schema
How do I fix Tailwind CSS v4 colors not working with shadcn/ui?

Tailwind CSS v4 colors fail when semantic tokens lack proper @theme inline mappings or root-level :root/.dark CSS variable definitions using hsl() values. Establishing a correct utility mapping layer ensures utilities like bg-background resolve properly across light and dark themes.

Why does dark mode switching break after migrating to Tailwind v4?

Dark mode switching breaks in Tailwind v4 due to misconfigured ThemeProvider wiring or missing .dark variable definitions. A reliable setup requires a ThemeProvider-backed dark mode flow and root-level CSS variables to ensure automatic theme transitions work correctly.

How do I set up semantic color tokens in a React Vite project using Tailwind v4?

Setting up semantic color tokens in React Vite requires defining hsl() values in :root/.dark and mapping them through @theme inline directives. This architecture ensures consistent utilities like text-foreground function correctly across both light and dark themes.

Do I need @theme inline directives for shadcn/ui to work with Tailwind CSS v4?

Yes, @theme inline directives are required for shadcn/ui to work with Tailwind CSS v4. They create the correct utility mapping layer between your CSS variables and semantic color tokens, preventing common v4 initialization failures and color resolution issues.

What is the best way to migrate shadcn/ui from Tailwind v3 to v4?

Migrating shadcn/ui from Tailwind v3 to v4 requires updating plugin loading via @plugin directives, converting to @theme inline mappings, and ensuring root-level :root/.dark variables use hsl() values to avoid common v4 gotchas during the transition.

Can I use Tailwind v4 with shadcn/ui without a ThemeProvider for dark mode?

Without a ThemeProvider, dark mode switching in Tailwind v4 and shadcn/ui becomes unreliable. A ThemeProvider-backed dark mode flow is required to ensure theme switching works automatically and semantic colors transition correctly between light and dark states.