tailwind-4

Guide Tailwind CSS 4 styling with patterns and critical rules.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/kim-yeo-appweb-lab/trend-korea-app --skill tailwind-4-kim-yeo-appweb-lab
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tailwind-4
Source: https://github.com/kim-yeo-appweb-lab/trend-korea-app/tree/main/.claude/skills/tailwind-4
Command: npx skills add https://github.com/kim-yeo-appweb-lab/trend-korea-app --skill tailwind-4-kim-yeo-appweb-lab

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides guidance on effectively using Tailwind CSS 4 for styling, focusing on best practices, common patterns, and avoiding pitfalls like using var() in class names or hex colors directly.

Core Features & Use Cases

  • Styling Decision Tree: Helps determine the best approach for applying styles (className, style prop, cn()).
  • Critical Rules: Enforces rules against var() in className and hex colors for consistency.
  • cn() Utility: Explains when and how to use the cn() utility for conditional and merged classes.
  • Common Patterns: Demonstrates practical examples for Flexbox, Grid, Spacing, Typography, Borders, States, Responsive design, and Dark Mode.
  • Use Case: When you're unsure whether to use className, style, or cn() for a specific styling need in your Next.js app, consult this Skill's decision tree and examples.

Quick Start

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

Frequently Asked Questions about tailwind-4

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

FAQPage Schema
What's the best way to apply dynamic styles in Tailwind CSS 4?

For Tailwind CSS 4 dynamic values like custom widths, use the style prop directly instead of constructing class names. Consult the styling decision tree to determine exactly when to use className, style, or the cn() utility.

How do I handle conditional styling and merge classes in Next.js?

Use the cn() utility for conditional styling and merging classes in Next.js. It provides a structured approach to combine multiple class names conditionally, ensuring clean component styling without class conflicts.

Why should I avoid using var() and hex colors directly in Tailwind classes?

Avoiding var() and hex colors in Tailwind className prevents parsing errors and maintains consistency. Instead, map dynamic values through the style prop or define them within the Tailwind configuration to ensure the compiler correctly processes styles.

How do I implement responsive design and dark mode with Tailwind CSS 4?

Implement responsive design and dark mode in Tailwind CSS 4 using built-in variant prefixes. Apply common patterns for Flexbox, Grid, Spacing, and Typography by appending responsive and dark state modifiers directly to utility classes.

Does Tailwind CSS 4 work with Next.js for frontend styling?

Yes, Tailwind CSS 4 works seamlessly with Next.js for frontend styling. It provides specific patterns for applying styles within Next.js applications, guiding you through the decision tree to choose between className, style, or cn().

When should I use the style prop instead of utility classes in Tailwind?

Use the style prop instead of utility classes when applying completely dynamic values derived from runtime variables. Tailwind CSS 4 cannot generate utility classes for arbitrary runtime values, so the style prop is necessary to inject dynamic styling.