tailwind-4

Provides Tailwind CSS 4 best practices for class naming and theming.

1|Updated Jan 17, 2026
One-click install
npx skills add https://github.com/phar-dev/phardev.dot --skill tailwind-4-phar-dev
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tailwind-4
Source: https://github.com/phar-dev/phardev.dot/tree/main/opencode/.config/opencode/skills/tailwind
Command: npx skills add https://github.com/phar-dev/phardev.dot --skill tailwind-4-phar-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Tailwind CSS 4 patterns and best practices streamline consistent styling, reduce confusion, and help teams avoid common pitfalls like using var() in className or hex colors.

Core Features & Use Cases

  • Clear guidance on when to use cn() for conditional styles and how to apply theme variables safely.
  • Best practices for avoiding inline hex colors and var() in className, with recommended semantic classes.
  • Real-world scenarios: component refactors, design system migrations, and scalable UI implementations.

Quick Start

Refactor a component to follow Tailwind-4 guidelines by replacing var() and hex colors with semantic classes and using cn() 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 use cn() for conditional Tailwind CSS classes in React components?▼

Avoid using var() directly in className attributes; instead, use semantic color classes and theme variables to maintain consistency, simplify design system updates, and prevent styling conflicts.

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

Avoid using var() and hex colors directly in className attributes; instead, apply semantic Tailwind CSS classes to maintain consistency, simplify design system updates, and prevent styling conflicts.

What is the best way to refactor components for Tailwind 4 best practices?▼

The best way to refactor components for Tailwind 4 is replacing inline hex colors and var() calls with semantic classes, while applying cn() for conditional styling to ensure production-ready UI.

How do I migrate a design system to Tailwind CSS 4 semantic color classes?▼

Migrate a design system to Tailwind CSS 4 by replacing hardcoded hex colors with semantic color classes and theme variables, ensuring scalable UI implementations and consistent styling.

What are common pitfalls when using Tailwind CSS for scalable UI implementations?▼

Common Tailwind CSS pitfalls include using var() in className, applying inline hex colors, and poor conditional styling management, which can be fixed using cn() and semantic classes.