tailwind-4

Standardize Tailwind styling by replacing inline var() and hex colors with cn() classes.

3|Updated Apr 5, 2023
One-click install
npx skills add https://github.com/mrp4sten/.dotfiles --skill tailwind-4-mrp4sten
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tailwind-4
Source: https://github.com/mrp4sten/.dotfiles/tree/main/development/IA/opencode/skill/tailwind-4
Command: npx skills add https://github.com/mrp4sten/.dotfiles --skill tailwind-4-mrp4sten

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Tailwind-4 patterns optimize UI styling by standardizing class usage and discouraging inline var() or hex colors.

Core Features & Use Cases

  • Guided rules for using cn() to compose classes, avoiding inline complex expressions.
  • Practical rules for avoiding CSS variables in className and preferring semantic Tailwind classes.
  • Use Case: Apply to React/Next.js projects to maintain consistent styling and reduce debugging of className strings.

Quick Start

Execute a project-wide refactor to replace inline var() and hex colors with Tailwind classes and the cn() helper to standardize styling.

Frequently Asked Questions about tailwind-4

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

FAQPage Schema
How do I standardize Tailwind CSS class usage to avoid messy className strings?

Standardize Tailwind CSS class usage by applying guided rules for the cn() helper, which composes classes cleanly and replaces inline complex expressions to prevent messy className strings. This approach reduces debugging time in frontend projects.

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

Avoid inline var() and hex colors in Tailwind className attributes to maintain consistent theming. Preferring semantic Tailwind classes over raw CSS variables standardizes styling systems and reduces debugging of component styles.

Can I use these Tailwind styling patterns with React and Next.js projects?

Yes, you can apply these Tailwind styling patterns to React, Next.js, and Vue projects. They are designed for frontend projects using Tailwind to maintain consistent styling across components and design tokens.

What is the best way to refactor a project to use semantic Tailwind classes?

The best way to refactor for semantic Tailwind classes is a project-wide update replacing inline var() and hex colors with Tailwind classes and the cn() helper, standardizing styling and ensuring scalable design tokens.

How does the cn() helper work when composing utility classes in Tailwind?

The cn() helper works by composing utility classes in Tailwind through guided rules, avoiding inline complex expressions. It provides a practical workflow for cleaner class merging and scalable styling in component libraries.

When do I need to refactor CSS variables out of my Tailwind components?

You need to refactor CSS variables out of Tailwind components when standardizing UI styling and design tokens. Replacing inline var() with semantic Tailwind classes ensures consistent theming and reduces debugging of className strings.