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.zipInstalls 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.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
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 —
@themedirective replacestailwind.config.js - CSS theme variables — every token exposed as a
--var - Native
@import— nopostcss-import - Automatic content detection — no
contentarray, 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 values —
grid-cols-15,mt-17work without arbitrary syntax - 3D transforms,
@starting-stylediscrete transitions,not-*variant
Install Paths
- Vite plugin (recommended):
@tailwindcss/vite - PostCSS:
@tailwindcss/postcss - CLI:
@tailwindcss/cli
Approach
- Use the Vite plugin when possible — fastest, fewest moving parts
- Move all theme tokens into
@theme { … }in your main CSS - Drop
postcss-importand any content-detection plugins - Use the upgrade tool:
npx @tailwindcss/upgradefor v3 → v4 - 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.jsin v4 — only needed for backward compat (use@config "./old.config.js";) - Forgetting that
contentis auto-detected — using@sourceonly 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 aprefers-color-schemestrategy 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.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| tailwind-v4-expert (this skill) | 0 | 2mo | No flags | Advanced |
| react-strict-dom | 1 | 6mo | Review | Advanced |
| ui-design-aesthetics | 0 | 3mo | No flags | Intermediate |
| frontend-design | 481 | 2mo | No flags | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by anubhavg-icpl
View all by anubhavg-icpl →You might also like
react-strict-dom
EvanBacon
Set up react-strict-dom with Babel, PostCSS, and CSS-wrapped HTML components for universal Expo apps
ui-design-aesthetics
NickCrew
Generates high-quality, non-generic UI designs with a focus on performance, progressive disclosure, and distinctive aesthetics.
frontend-design
anthropics
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
screenshot-to-code
OneWave-AI
Convert UI screenshots into working HTML/CSS/React/Vue code. Detects design patterns, components, and generates responsive layouts. Use this when users provide screenshots of websites, apps, or UI designs and want code implementation.
ui-ux-expert-skill
fercracix33
Technical workflow for implementing accessible React user interfaces with shadcn/ui, Tailwind CSS, and TanStack Query. Includes 6-phase process with mandatory Style Guide compliance, Context7 best practices consultation, Chrome DevTools validation, and WCAG 2.1 AA accessibility standards. Use after Test Agent, Implementer, and Supabase agents complete their work.
shadcn-ui-setup
maneeshanif
Install and configure Shadcn/ui component library with Radix UI primitives, Aceternity UI effects, set up components, and manage the component registry. Use when adding Shadcn/ui to a Next.js project or installing specific UI components for Phase 2.