tailwind-4

Apply Tailwind CSS 4 styling patterns with utility classes and cn().

Updated Feb 21, 2026
One-click install
npx skills add https://github.com/josemartinrodriguezmortaloni/opencode-config --skill tailwind-4-josemartinrodriguezmortaloni
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tailwind-4
Source: https://github.com/josemartinrodriguezmortaloni/opencode-config/tree/main/skill/tailwind-4
Command: npx skills add https://github.com/josemartinrodriguezmortaloni/opencode-config --skill tailwind-4-josemartinrodriguezmortaloni

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides clear guidelines and best practices for using Tailwind CSS 4, ensuring consistent, maintainable, and efficient styling in your projects.

Core Features & Use Cases

  • Styling Best Practices: Learn when to use cn(), className, and the style prop.
  • Rule Enforcement: Avoid common pitfalls like using var() or hex colors directly in class names.
  • Use Case: Quickly reference the correct way to apply conditional styling or responsive design using Tailwind's utility classes.

Quick Start

Use the tailwind-4 skill to apply a flexbox layout with items centered and space between.

Frequently Asked Questions about tailwind-4

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

FAQPage Schema
How do I apply conditional styling in Tailwind CSS 4?

Conditional styling in Tailwind CSS 4 is applied using the cn() utility to merge class names cleanly, avoiding anti-patterns like var() or hex colors directly in classNames. Use cn() to toggle utility classes based on component state for maintainable styling.

What's the best way to handle dynamic values in Tailwind utility classes?

Dynamic values in Tailwind should be handled via the style prop rather than injecting arbitrary values into className strings. This approach enforces semantic class usage and prevents common anti-patterns like constructing class names with CSS var() functions.

Does Tailwind CSS 4 work with flexbox and grid for responsive design?

Tailwind CSS 4 provides utility classes for common use cases including flexbox, grid, typography, and responsive design. You apply these utilities directly in your className to build layouts that adapt to different screen sizes without writing custom CSS.

Why should I avoid var() in Tailwind class names?

Using var() or hex colors directly in Tailwind class names is an anti-pattern that breaks utility class consistency. You should instead use semantic utility classes for colors and pass dynamic CSS variables through the style prop to maintain clean class name structures.

When do I need the cn() utility for styling components?

You need the cn() utility when applying conditional styling or merging multiple class names in Tailwind CSS 4. It ensures consistent class application by safely combining base utility classes with conditional ones, preventing styling conflicts and maintaining semantic class usage.