tailwind-4

Guide Tailwind CSS styling with utility classes, cn(), and theming rules.

1|Updated Dec 30, 2025
One-click install
npx skills add https://github.com/statick88/dotfiles --skill tailwind-4-statick88
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tailwind-4
Source: https://github.com/statick88/dotfiles/tree/main/amp/.agents/skills/tailwind-4
Command: npx skills add https://github.com/statick88/dotfiles --skill tailwind-4-statick88

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides clear guidelines and best practices for using Tailwind CSS, ensuring consistent, maintainable, and efficient styling across your projects. It helps avoid common pitfalls and promotes optimal usage of utility classes and theming.

Core Features & Use Cases

  • Styling Decision Tree: Guides you on choosing the right approach for different styling needs (utility classes, style prop, cn() utility).
  • Critical Rules: Enforces best practices like avoiding var() in className and using semantic Tailwind color classes instead of hex codes.
  • cn() Utility Usage: Demonstrates when and how to effectively use the cn() utility for conditional and merged class names.
  • Dynamic Values & Theming: Shows how to handle dynamic values and integrate with CSS custom properties for theming.
  • Common Patterns: Provides examples for Flexbox, Grid, Spacing, Typography, Borders, Shadows, States, Responsive design, and Dark Mode.
  • Arbitrary Values: Explains the correct use of arbitrary values as an escape hatch.

Quick Start

Use the tailwind-4 skill to understand how to apply dynamic width to an element using the style prop.

Frequently Asked Questions about tailwind-4

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

FAQPage Schema
How do I use Tailwind CSS utility classes for conditional styling?

Apply the `cn()` utility to merge Tailwind CSS class names conditionally, resolving conflicts when combining base styles with dynamic state classes for cleaner component styling.

Why should I avoid var() and hex colors in Tailwind className?

Avoid `var()` and hex colors in Tailwind className to prevent purge issues; instead, use semantic Tailwind color classes mapped to CSS custom properties for reliable theming.

What is the best way to handle dynamic values in Tailwind CSS?

Handle dynamic Tailwind CSS values using the `style` prop for exact runtime dimensions, or use arbitrary values as a static escape hatch for one-off customizations not available by default.

How to implement responsive design and dark mode with Tailwind CSS?

Implement responsive design and dark mode in Tailwind CSS using breakpoint prefixes like `md:` and the `dark:` variant, applying them directly within utility classes for adaptive layouts.

When should I use arbitrary values instead of standard utility classes?

Use Tailwind CSS arbitrary values as an escape hatch for one-off custom properties or spacing not covered by standard utility classes, ensuring standard utilities remain the default.