tailwind-patterns

Configure Tailwind CSS v4 with CSS-first themes, container queries, and design tokens.

Updated Aug 11, 2026
One-click install
npx skills add https://github.com/DucCuong159/Realtime-chatapp --skill tailwind-patterns-duccuong159
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tailwind-patterns
Source: https://github.com/DucCuong159/Realtime-chatapp/tree/main/.agent/skills/tailwind-patterns
Command: npx skills add https://github.com/DucCuong159/Realtime-chatapp --skill tailwind-patterns-duccuong159

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It guides developers through Tailwind CSS v4's CSS-first architecture, replacing legacy JavaScript config files with @theme directives, container queries, and modern design token patterns. ## Core Features & Use Cases - CSS-First Configuration: Define themes, colors, spacing, and typography using the @theme directive instead of tailwind.config.js. - Container Queries & Responsive Design: Implement component-level responsive layouts with @container and mobile-first breakpoint patterns. - Design Token Architecture: Structure primitive, semantic, and component-level color tokens using OKLCH and CSS variables. - Use Case: When migrating a project from Tailwind v3 to v4, use this Skill to convert the JavaScript config into CSS-based @theme tokens and adopt container queries for reusable card components. ## Quick Start Ask the AI to configure a Tailwind v4 theme with semantic color tokens and a container-query-based card layout.

Frequently Asked Questions about tailwind-patterns

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

FAQPage Schema
How do I configure Tailwind CSS v4 without tailwind.config.js?

Tailwind v4 uses CSS-first configuration via the @theme directive in your stylesheet. Define colors, spacing, and fonts as CSS variables like --color-primary directly in CSS, replacing the JavaScript config file entirely.

How do container queries work in Tailwind CSS v4?

Add @container to a parent element, then use container breakpoints like @sm: or @md: on children. Named containers such as @container/card allow targeting specific contexts, making components responsive to their parent rather than the viewport.

What changed between Tailwind v3 and v4?

Tailwind v4 replaces tailwind.config.js with CSS-based @theme configuration, uses the Rust-based Oxide engine for faster builds, supports native CSS nesting, and exposes all tokens as CSS variables. JIT mode is now always on.

Does Tailwind v4 support dark mode with a custom selector?

Yes, Tailwind v4 supports class-based, media-based, and custom selector dark mode strategies. Use the class strategy with a .dark toggle for manual theme switchers, or media to follow system preferences automatically.

When should I use container queries instead of breakpoints?

Use container queries for reusable components that must adapt to their parent width, such as cards in varying layouts. Use viewport breakpoints for page-level layouts where the overall screen size drives the design.

Why should I avoid heavy @apply usage in Tailwind v4?

Heavy @apply usage duplicates utility output and undermines the utility-first model. Prefer extracting repeated class combinations into React or Vue components, reserving @apply for static styles without JavaScript logic.