tailwind-css

Guide Tailwind CSS v4+ configuration with @theme and @apply directives.

Updated Mar 13, 2026
One-click install
npx skills add https://github.com/devbyray/nuxt-layers-component-lib-poc --skill tailwind-css-devbyray
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tailwind-css
Source: https://github.com/devbyray/nuxt-layers-component-lib-poc/tree/main/.github/skills/tailwind-css
Command: npx skills add https://github.com/devbyray/nuxt-layers-component-lib-poc --skill tailwind-css-devbyray

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides clear standards and best practices for using Tailwind CSS v4+, ensuring consistent and efficient styling across projects.

Core Features & Use Cases

  • Configuration Standards: Learn how to configure Tailwind v4+ using the @theme directive for custom colors, spacing, and more.
  • Best Practices: Understand how to use @apply, @layer, and custom utilities for maintainable CSS.
  • Responsive & State Design: Implement responsive layouts and interactive states effectively.
  • Use Case: When starting a new project or refactoring existing styles, consult this Skill to ensure your Tailwind CSS implementation follows the latest standards and best practices for maintainability and performance.

Quick Start

Follow the Tailwind CSS standards for configuring custom colors and using the @apply directive.

Frequently Asked Questions about tailwind-css

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

FAQPage Schema
How do I configure custom colors and spacing in Tailwind CSS v4?

Configure custom colors and spacing in Tailwind CSS v4 using the `@theme` directive within your CSS file. This modern approach replaces the legacy JavaScript configuration file, allowing you to define design tokens directly in your stylesheets for efficient custom theming.

What is the best way to use @apply for maintainable component styling?

The best way to use `@apply` for maintainable component styling is within the `@layer` directive. This ensures your custom utility classes and component styles are properly ordered in the CSS cascade, preventing specificity issues and keeping your stylesheets organized.

How does responsive design implementation work with Tailwind utility classes?

Responsive design implementation works by appending breakpoint prefixes to Tailwind utility classes, such as `md:` or `lg:`. This mobile-first approach allows you to apply different styling rules based on screen size directly in your HTML markup without writing custom media queries.

Can I refactor existing styles to follow modern Tailwind CSS standards?

Yes, you can refactor existing styles to follow modern Tailwind CSS standards by migrating legacy configurations to the `@theme` directive and consolidating repetitive styles into custom utilities using `@apply`. This ensures your project adheres to v4+ best practices for maintainability.

When do I need custom utilities versus standard Tailwind classes?

You need custom utilities when standard Tailwind classes do not cover specific design requirements or interactive states. Define them using the `@layer` directive to maintain CSS ordering and ensure your custom styles integrate seamlessly with the existing framework architecture.

Why use the @theme directive instead of a JavaScript config file in Tailwind v4?

Use the `@theme` directive instead of a JavaScript config file in Tailwind v4 because it allows you to define custom theming variables directly in CSS. This simplifies the build process and ensures your design system configuration adheres to modern styling standards natively.