TA

tailwind-v4-expert

Modern web development expertise using Tailwind CSS v4 features and best practices.

Install

mkdir -p .claude/skills/tailwind-v4-expert && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/11822" && unzip -o skill.zip -d .claude/skills/tailwind-v4-expert && rm skill.zip

Installs to .claude/skills/tailwind-v4-expert

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Expert in Tailwind CSS v4, the Oxide engine, CSS-first config, and modern utilities. Use when building web applications with tailwind v4.
137 chars✓ has a “when” trigger
Advanced

Key capabilities

  • Configure design systems CSS-first using `@theme` directive
  • Utilize Oxide engine for faster builds
  • Integrate with Vite using `@tailwindcss/vite` plugin
  • Implement container queries without plugins
  • Use P3 OKLCH color palette
  • Create custom utilities with `@utility`

How it works

The skill applies Tailwind CSS v4 features, including the Oxide engine and CSS-first configuration, to build and optimize web application styles.

Inputs & outputs

You give it
Web application design requirements
You get back
Tailwind CSS v4 configuration and optimized styles

When to use tailwind-v4-expert

  • Upgrade to Tailwind v4
  • Configure CSS theme variables
  • Optimize CSS performance

About this skill

Tailwind v4 Expert Mode

You are an expert in Tailwind CSS v4 (Oxide engine). You configure design systems CSS-first, use container queries and modern color/transform utilities, and build with the new first-party Vite plugin.

Core Competencies

What's New in v4

  • Oxide engine (Rust) — full builds ~3.78x faster, incremental ~8.8x, no-change rebuilds 182x (microseconds)
  • CSS-first config@theme directive replaces tailwind.config.js
  • CSS theme variables — every token exposed as a --var
  • Native @import — no postcss-import
  • Automatic content detection — no content array, respects .gitignore
  • First-party Vite plugin (@tailwindcss/vite) — best DX
  • P3 OKLCH color palette — wider gamut
  • Container queries built-in (@container, @sm:, @max-md:)
  • Dynamic utility valuesgrid-cols-15, mt-17 work without arbitrary syntax
  • 3D transforms, @starting-style discrete transitions, not-* variant

Install Paths

  • Vite plugin (recommended): @tailwindcss/vite
  • PostCSS: @tailwindcss/postcss
  • CLI: @tailwindcss/cli

Approach

  1. Use the Vite plugin when possible — fastest, fewest moving parts
  2. Move all theme tokens into @theme { … } in your main CSS
  3. Drop postcss-import and any content-detection plugins
  4. Use the upgrade tool: npx @tailwindcss/upgrade for v3 → v4
  5. Embrace OKLCH colors — better perceptual uniformity than HSL/RGB

Key Patterns

Vite Setup

// vite.config.ts
import tailwindcss from '@tailwindcss/vite';
export default defineConfig({ plugins: [tailwindcss()] });
/* src/styles.css */
@import "tailwindcss";

@theme {
  --font-display: "Satoshi", "sans-serif";
  --color-brand-50:  oklch(0.97 0.02 280);
  --color-brand-500: oklch(0.62 0.20 280);
  --color-brand-900: oklch(0.25 0.10 280);
  --breakpoint-3xl: 1920px;
  --ease-fluid: cubic-bezier(0.3, 0, 0, 1);
}

These tokens automatically generate utilities: bg-brand-500, text-brand-900, font-display, 3xl:flex, ease-fluid.

PostCSS Setup

// postcss.config.js
export default { plugins: ['@tailwindcss/postcss'] };

Container Queries (no plugin)

<aside class="@container">
  <div class="grid grid-cols-1 @sm:grid-cols-2 @max-md:grid-cols-1 gap-4">
    <!-- responds to the aside's width, not viewport -->
  </div>
</aside>

Dynamic Values

<div class="grid grid-cols-15 gap-x-7 mt-17 pr-29">…</div>
<div data-current class="data-current:opacity-100 data-current:font-bold">…</div>

Custom Utilities (@utility)

@utility content-auto {
  content-visibility: auto;
}
@utility tab-* {
  tab-size: --value(integer);
}
/* now <div class="content-auto"> and <pre class="tab-4"> work */

Custom Variants

@custom-variant dark (&:where(.dark, .dark *));
@custom-variant child (& > *);

Modern Gradients & Transforms

<div class="bg-linear-45 from-brand-500 to-brand-900"></div>
<div class="bg-conic from-purple-500 via-pink-500 to-rose-500"></div>
<article class="perspective-distant">
  <div class="rotate-x-45 rotate-z-12 transform-3d">3D card</div>
</article>

@starting-style (entry transitions)

<div popover class="opacity-100 transition-discrete starting:open:opacity-0">
  Tooltip
</div>

Override CSS Variables Per-Scope

.theme-marketing {
  --color-brand-500: oklch(0.7 0.22 50);  /* swap brand color in this subtree */
}

Common Pitfalls

  • Keeping a tailwind.config.js in v4 — only needed for backward compat (use @config "./old.config.js";)
  • Forgetting that content is auto-detected — using @source only when files live outside the project root
  • Continuing to import postcss-import — Tailwind v4 handles imports natively
  • Mixing v3 plugin packages — most are no-ops or break in v4
  • Using dark: without setting up a prefers-color-scheme strategy or @custom-variant dark
  • Hard-coding hex colors in @theme — prefer OKLCH for the wide-gamut palette

When to Use This Mode

  • Greenfield projects (always v4)
  • Migrating from Tailwind v3 (use the official upgrade codemod)
  • Container-aware layouts (sidebars, dashboards, embedded widgets)
  • Design systems that want CSS-variable-driven theming
  • Performance-sensitive apps where build time matters

Sources

When not to use it

  • Keeping a `tailwind.config.js` in v4 for theme configuration
  • Continuing to import `postcss-import`
  • Mixing v3 plugin packages with v4

Limitations

  • Requires using Tailwind CSS v4
  • Assumes a CSS-first configuration approach
  • Does not support `tailwind.config.js` for theme in v4

How it compares

This skill focuses on the new CSS-first configuration and Oxide engine of Tailwind v4, offering performance and theming advantages over previous versions or generic CSS frameworks.

Compared to similar skills

tailwind-v4-expert side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
tailwind-v4-expert (this skill)02moNo flagsAdvanced
react-strict-dom16moReviewAdvanced
ui-design-aesthetics03moNo flagsIntermediate
frontend-design4812moNo flagsAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

Search skills

Search the agent skills registry