tailwind-4

Guide Tailwind CSS styling with utility classes and the cn() utility.

Updated May 14, 2025
One-click install
npx skills add https://github.com/Mikisbell/freecloud --skill tailwind-4-mikisbell
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tailwind-4
Source: https://github.com/Mikisbell/freecloud/tree/main/.agents/skills/tailwind-4
Command: npx skills add https://github.com/Mikisbell/freecloud --skill tailwind-4-mikisbell

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides clear guidelines and best practices for using Tailwind CSS effectively, preventing common anti-patterns and ensuring maintainable styling.

Core Features & Use Cases

  • Styling Decision Tree: A flowchart to guide your styling choices.
  • Critical Rules: Strict enforcement against var() in classNames and hex colors.
  • cn() Utility: Proper usage and when not to use the clsx/twMerge utility.
  • Dynamic Values & Theming: How to handle dynamic content and theme variables.
  • Common Patterns: Examples for Flexbox, Grid, Spacing, Typography, Borders, States, Responsive design, and Dark Mode.
  • Arbitrary Values: When and how to use them as an escape hatch.

Quick Start

Use the tailwind-4 skill to understand when to use the cn() utility for conditional styling.

Frequently Asked Questions about tailwind-4

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

FAQPage Schema
How do I handle dynamic values and theme variables in Tailwind CSS?

Use the `cn()` utility for conditional styling and apply specific patterns for dynamic content and theme variables. This approach prevents common anti-patterns and ensures maintainable styling when working with dynamic values in Tailwind CSS.

Why should I avoid using var() in Tailwind CSS classNames?

Avoid using `var()` in Tailwind CSS classNames because it is a critical anti-pattern that breaks utility class generation. Strict enforcement against `var()` and hex colors ensures maintainable styling and prevents common issues within your styling workflow.

What is the best way to use the cn() utility for conditional styling?

The best way to use the `cn()` utility for conditional styling is to apply it specifically when merging Tailwind CSS classes conditionally. Follow the provided guidelines to understand exactly when to use it and when to avoid the `clsx` or `twMerge` utilities.

Can I use hex colors and arbitrary values in Tailwind CSS utility classes?

You can use arbitrary values in Tailwind CSS utility classes as an escape hatch for specific styling needs, but you must strictly avoid hex colors. Critical rules enforce against using hex colors directly to ensure maintainable styling and prevent common anti-patterns.

How do I structure responsive design and dark mode patterns with Tailwind CSS utility classes?

Structure responsive design and dark mode patterns with Tailwind CSS utility classes by following the provided common pattern examples for Flexbox, Grid, Spacing, and Typography. These patterns guide your styling decisions and ensure proper state handling across different screen sizes.