tailwind

Builds Tailwind CSS design systems with design tokens, CVA variants, and dark mode.

3|Updated Nov 8, 2014
One-click install
npx skills add https://github.com/mintuz/.dotfiles --skill tailwind-mintuz
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tailwind
Source: https://github.com/mintuz/.dotfiles/tree/main/agents/.agents/skills/tailwind
Command: npx skills add https://github.com/mintuz/.dotfiles --skill tailwind-mintuz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building consistent component libraries with Tailwind CSS requires correct handling of design tokens, variant patterns, and version-specific syntax, and mistakes like dynamic class names silently break styles in production. ## Core Features & Use Cases - Design Token Architecture: Set up semantic color tokens with CSS variables and dark mode for both Tailwind 3 (config-based) and Tailwind 4 (CSS-first @theme). - Type-Safe Component Variants: Create Button, Badge, and Dialog components using CVA or dependency-free Record<Variant, string> maps with literal class names. - Animations and Utilities: Apply tailwindcss-animate entry/exit transitions and compose classes with the cn() helper built on clsx and tailwind-merge. - Use Case: When adding a new Button component to a React component library, use this Skill to define semantic tokens, wire up CVA variants with correct focus and disabled states, and ensure every class name is literal so Tailwind generates the styles. ## Quick Start Use the tailwind skill to create a Button component with primary, destructive, and outline variants that supports dark mode.

Frequently Asked Questions about tailwind

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

FAQPage Schema
How do I create type-safe Tailwind component variants?▼

Use CVA (class-variance-authority) to define base styles plus named variant groups like variant and size, which gives TypeScript inference for props. If the package is not installed, use an exhaustive Record<Variant, string> map with complete literal class strings instead.

Why are my Tailwind classes not generated in production?▼

Tailwind scans source files as plain text and never evaluates code, so class names built by interpolation like `bg-${color}-600` are never generated. Map each dynamic value to a complete literal class string in your source instead of using a safelist.

What is the difference between Tailwind 3 and Tailwind 4 setup?▼

Tailwind 3 uses a tailwind.config file with @tailwind directives and theme.extend tokens, while Tailwind 4 is CSS-first using @import "tailwindcss" and @theme blocks with automatic source detection. Always read the installed version before writing syntax since the two are not interchangeable.

How do I set up dark mode with Tailwind CSS?▼

In Tailwind 3, set darkMode to "class" in the config and redefine CSS variables under a .dark selector. In Tailwind 4, use @custom-variant for the dark selector and @theme inline so utilities follow runtime-switching CSS variables.

When should I use CVA versus a plain variant map?▼

Use CVA when the project already installs class-variance-authority or when a component has several independent variant axes like variant plus size. Otherwise use an exhaustive Record<Variant, string> map, which is the dependency-free equivalent and also keeps class names literal.

How do I merge Tailwind classes without conflicts?▼

Use a cn() helper combining clsx for conditional classes and tailwind-merge to resolve conflicts so later classes win. Without those dependencies, join strings with plain JavaScript but ensure the joined strings do not set the same property twice.