Configures and styles Tailwind CSS v4 components, including CSS-first configuration, custom utilities, variants with tailwind-variants, and animations with tw-animate-css.
How this skill is triggered — by the user, by Claude, or both
Slash command
/paulrberg-agent-skills:tailwind-cssThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Tailwind CSS v4 eliminates `tailwind.config.ts` in favor of CSS-only configuration. All configuration lives in CSS files using special directives.
Tailwind CSS v4 eliminates tailwind.config.ts in favor of CSS-only configuration. All configuration lives in CSS files using special directives.
Core Directives:
@import "tailwindcss" - Entry point that loads Tailwind@theme { } - Define or extend design tokens@theme static { } - Define tokens that should not generate utilities@utility - Create custom utilities@custom-variant - Define custom variantsMinimal Example:
@import "tailwindcss";
@theme {
--color-brand: oklch(0.72 0.11 178);
--font-display: "Inter", sans-serif;
--spacing-edge: 1.5rem;
}
All theme tokens defined with @theme automatically become available as utility classes. For example, --color-brand can be used as bg-brand, text-brand, border-brand, etc.
Read references/eslint.md when wiring Tailwind lint rules.
For detailed coding patterns covering layout, spacing, typography, colors, borders, gradients, arbitrary values, class merging, image sizing, z-index, and dark mode, see references/coding-preferences.md.
Use CSS Modules only as a last resort for complex CSS that cannot be easily written with Tailwind classes.
All .module.css files must include @reference "#tailwind"; at the top to enable Tailwind utilities and theme tokens inside the module.
Example:
/* component.module.css */
@reference "#tailwind";
.component {
/* Complex CSS that can't be expressed with Tailwind utilities */
/* Can still use Tailwind utilities and theme tokens */
}
references/tailwind-variants.md for patterns@theme configuration for available tokenstv() from tailwind-variants for type-safe variantsExample:
import { tv } from "tailwind-variants";
const button = tv({
base: "rounded-lg px-4 py-2 font-medium",
variants: {
color: {
primary: "bg-blue-600 text-white",
secondary: "bg-gray-600 text-white",
},
size: {
sm: "text-sm",
md: "text-base",
lg: "text-lg",
},
},
});
references/tailwind-v4-rules.md for breaking changesbg-linear-*, not bg-gradient-*)bg-my-color, not bg-[--var-my-color])@theme configuration@theme configuration first to see available colors/20, /50, etc.)Example:
// ✅ Good: theme token with opacity
<div className="bg-brand/20 text-brand">
// ❌ Avoid: arbitrary hex
<div className="bg-[#4f46e5]/20 text-[#4f46e5]">
references/tw-animate-css.md for available animationsanimate-in or animate-out) with effect classes[0.625rem] syntax, not 2.5Example:
// Enter: fade + slide up
<div className="fade-in slide-in-from-bottom-4 duration-300 animate-in">
// Exit: fade + slide down
<div className="fade-out slide-out-to-bottom-4 duration-200 animate-out">
| Aspect | Pattern |
|---|---|
| Configuration | CSS-only: @theme, @utility, @custom-variant |
| Line Height | Modifier syntax: text-base/7 |
| Font Features | font-features-zero, font-features-ss01, etc. |
| CSS Variables | bg-my-color (auto-created from @theme) |
| Class Merging | cn() for conditionals; plain string for static |
| Viewport | min-h-dvh (not min-h-screen) |
references/tailwind-v4-rules.md — Breaking changes, removed/renamed utilities, layout rules, typography, gradients, CSS variables, new v4 features, common pitfallsreferences/tailwind-variants.md — Component variants, slots API, composition, TypeScript integration, responsive variantsreferences/tw-animate-css.md — Enter/exit animations, slide/fade/zoom utilities, spacing gotchasreferences/eslint.md — Correctness/stylistic rules for eslint-plugin-better-tailwindcss, read when wiring Tailwind lint rulesnpx claudepluginhub joshuarweaver/cascade-code-general-misc-1 --plugin paulrberg-agent-skillsTailwind CSS v4 utility-first discipline: CSS-first configuration, design tokens via @theme, and principled class composition. Invoke whenever task involves any interaction with Tailwind CSS — writing, reviewing, refactoring, debugging, or understanding utility classes, theme configuration, custom utilities, dark mode, or Tailwind integration with frameworks.
Provides 29 rules for consistent Tailwind CSS including responsive design, dark mode, component patterns, configuration, and v3-to-v4 migration.
Covers Tailwind CSS utility patterns, responsive design, component patterns, v4 migration, and configuration. Includes a layout decision tree and breakpoint quick reference.