skills/calel33/tailwind-css-v4-mastery/SKILL.md
Expert guidance for leveraging Tailwind CSS V4's new Oxide engine, CSS-first configuration, and modern styling paradigms. This skill transforms Claude into a Tailwind V4 architecture specialist, capable of designing component systems, optimizing performance, and executing complex styling challenges with precision.
npx skillsauth add aiskillstore/marketplace tailwind-css-v4-masteryInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Tailwind V4 represents a philosophical shift from JavaScript-centric utility frameworks to CSS-native, declarative styling. This skill installs that mental model:
@theme {} replaces tailwind.config.js@property, color-mix(), CSS nestingThe correct mental model for V4: "CSS is the source of truth. JavaScript configuration is outdated."
What Changed:
v3: JavaScript → JavaScript Parser → CSS Output
v4: CSS @theme → Rust/Oxide Engine → Optimized CSS Output
Why It Matters:
Mental Model: Think of the Oxide engine as a compiler, not a preprocessor. It compiles CSS declarations into optimized output.
The Core Shift:
| Aspect | v3 | v4 |
|--------|-----|-----|
| Config Format | JavaScript Object | CSS @theme {} Block |
| Location | tailwind.config.js | styles.css |
| Execution | Node.js at build time | Oxide engine |
| Debugging | Console logs, file inspection | CSS DevTools |
| Scope | Global import | CSS cascade-aware |
Why This Matters: CSS-first configuration is more maintainable, debuggable, and aligned with how browsers actually work. You're no longer fighting a layer of abstraction.
Tailwind V4 requires modern browser capabilities:
@property)color-mix())This is intentional. V4 assumes modern CSS and optimizes around it. Legacy support requires v3.4.x.
Trigger: User wants to upgrade existing Tailwind project from v3 to v4
Steps:
Audit Phase
tailwind.config.js overridesInstallation Phase
npm install -D tailwindcss@latest
npm install -D @tailwindcss/vite # (or @tailwindcss/postcss or @tailwindcss/cli)
Configuration Migration
theme: {} → @theme { --var: value; }extend: {} → Additional --var in @theme@tailwind base/components/utilities → @import "tailwindcss"Utility Refactoring
.shadow → .shadow-sm.rounded → .rounded-sm.outline-none → .outline-hidden.bg-opacity-* → .bg-black/* (slash syntax)Validation
Decision Tree:
Is this a new project?
├─ YES → Use V4 directly with @theme config
└─ NO → Execute migration workflow above
├─ Does v3 use custom config extensively?
│ ├─ YES → Allocate migration time, go step-by-step
│ └─ NO → Quick migration, 30 mins
└─ Are you on legacy browsers?
├─ YES → Stay on v3.4
└─ NO → Proceed with v4
Trigger: User wants to build reusable component library with Tailwind V4
Steps:
Define Component Scope
Create Base Theme
@import "tailwindcss";
@theme {
/* Color system */
--color-primary-*: oklch(...);
--color-neutral-*: oklch(...);
/* Spacing scale */
--spacing-xs: 0.25rem;
--spacing-sm: 0.5rem;
--spacing-md: 1rem;
/* Typography */
--font-display: "Custom", sans-serif;
--font-body: "System", sans-serif;
}
Build Component Classes
@layer components {
.btn-primary {
@apply px-4 py-2 rounded-sm bg-primary text-white
font-semibold transition-all hover:opacity-90;
}
.card {
@apply p-6 rounded-lg bg-white shadow-md border border-gray-200;
}
}
Establish Modifier Conventions
.btn-sm, .btn-lg.btn-disabled, .btn-loading.btn-primary, .btn-secondaryDocument & Export
Output: Production-ready component library CSS file
Trigger: User needs to optimize Tailwind V4 performance
Steps:
Baseline Measurement
Plugin Selection
@tailwindcss/vite (fastest option)Configuration Tuning
// vite.config.ts
import tailwindcss from "@tailwindcss/vite";
export default defineConfig({
plugins: [react(), tailwindcss()]
});
CSS Variable Optimization
@theme block duplicationValidation
Expected Outcomes:
What build tool do you use?
├─ Vite (React, Vue, Svelte)
│ └─ Use @tailwindcss/vite (fastest, recommended)
├─ Webpack (NextJS, CRA)
│ └─ Use @tailwindcss/postcss
├─ Standalone/No bundler
│ └─ Use @tailwindcss/cli
└─ PostCSS pipeline
└─ Use @tailwindcss/postcss
How complex is your theme?
├─ Simple (5-10 color overrides)
│ └─ Use inline @theme block in styles.css
├─ Moderate (custom colors, spacing, fonts)
│ └─ Use single @theme block with organization
├─ Complex (multi-theme, extensive customization)
│ └─ Split into @layer base blocks with [data-theme] selectors
└─ Enterprise (multiple brands)
└─ Use CSS variable strategy with fallbacks
When should I use @layer components?
├─ Recurring utility combinations
│ └─ YES → Extract to .btn-primary, .card, etc.
├─ One-off layouts
│ └─ NO → Use utilities directly in HTML
├─ Design system compliance needed
│ └─ YES → Extract as component class
└─ User will customize per instance
└─ NO → Leave as utility composition
tailwind.config.js to Still WorkProblem: File is ignored in v4.
Solution: Use @theme {} in CSS instead.
Prevention: Delete tailwind.config.js early in migration.
Problem: v3 used currentColor (inherits text), v4 uses #e5e7eb.
Solution: Use .border-current if you need inherited color.
Prevention: Test all border utilities during migration.
Problem: Existing .ring classes now have thinner outlines.
Solution: Use .ring-3 for old 3px behavior, .ring-1 for new default.
Prevention: Find/replace .ring → .ring-1 during migration.
-- PrefixProblem: @theme { color-primary: value; } is ignored.
Solution: Use @theme { --color-primary: value; }.
Prevention: Always use -- in @theme blocks.
Problem: .bg-opacity-50 no longer exists.
Solution: Use CSS color modifiers: .bg-black/50.
Prevention: Search codebase for opacity utilities and replace during migration.
All detailed references are stored in references/:
@theme setup patterns✅ Use this skill when:
❌ Don't use this skill when:
When activated by user query:
This skill enables Claude to:
Skill Version: 1.0.0
Last Updated: 2025-01-01
Status: Production Ready
development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.