Loading...
Loading...
Tailwind CSS v4.x utility-first CSS framework best practices. Use when styling web applications with utility classes, building responsive layouts, customizing design systems with @theme variables, migrating from v3 to v4, configuring dark mode, creating custom utilities with @utility, or working with any Tailwind CSS v4 features. This skill covers the full v4.x line through v4.2 including text shadows, masks, logical properties, and source detection. Use this skill even for simple Tailwind questions — v4 changed many class names and configuration patterns that trip people up.
npx skill4agent add biggora/claude-plugins-registry tailwindcss-best-practicesCovers Tailwind CSS v4.0 through v4.2.2 (latest stable as of March 2026). Always check the official docs at https://tailwindcss.com/docs for the latest.
@theme@utility@custom-varianttailwind.config.js| v3 (old) | v4 (correct) | Why it changed |
|---|---|---|
| | Important modifier moved from prefix to suffix |
| | Opacity modifiers removed; use slash syntax on the color |
| | Shadow scale shifted down one step |
| | Shadow scale shifted down one step |
| | Border radius scale shifted down one step |
| | Border radius scale shifted down one step |
| | Default ring width changed from 3px to 1px |
| | Renamed for clarity |
| | Shorter alias is now the only form |
| | Shorter alias is now the only form |
| | Renamed for consistency |
| | Blur scale shifted down one step |
| | Single CSS import replaces three directives |
| | CSS-first configuration replaces JS config |
| | Dark mode config moves to CSS |
| | CSS variable arbitrary values use parentheses |
| | Theme function uses CSS variable names |
| | Custom utilities use dedicated directive |
| | Deprecated in v4.2 |
| Topic | Description | Reference |
|---|---|---|
| Installation | Vite, PostCSS, Webpack, CLI, and CDN setup | core-installation |
| Utility Classes | Understanding Tailwind's utility-first approach | core-utility-classes |
| Theme Variables | Design tokens, | core-theme |
| Responsive Design | Mobile-first breakpoints, responsive variants, container queries | core-responsive |
| Variants | Conditional styling with state, pseudo-class, media query, and pointer variants | core-variants |
| Preflight | Tailwind's base styles and how to extend or disable them | core-preflight |
| Source Detection | How Tailwind detects classes, | core-source-detection |
| Topic | Description | Reference |
|---|---|---|
| Display | flex, grid, block, inline, hidden, sr-only, flow-root, contents | layout-display |
| Flexbox | flex-direction, justify, items, gap, grow, shrink, wrap, order | layout-flexbox |
| Grid | grid-cols, grid-rows, gap, place-items, col-span, row-span, subgrid | layout-grid |
| Aspect Ratio | Controlling element aspect ratio for responsive media | layout-aspect-ratio |
| Columns | Multi-column layout for magazine-style or masonry layouts | layout-columns |
| Topic | Description | Reference |
|---|---|---|
| Position | Controlling element positioning with static, relative, absolute, fixed, and sticky | layout-position |
| Inset | Placement of positioned elements with inset, logical inset ( | layout-inset |
| Topic | Description | Reference |
|---|---|---|
| Width | Setting element width with spacing scale, fractions, container sizes, viewport units | layout-width |
| Height | Setting element height with spacing scale, fractions, viewport units | layout-height |
| Min & Max Sizing | min-width, max-width, min-height, max-height constraints | layout-min-max-sizing |
| Logical Sizing | Writing-mode-aware sizing: | layout-logical-properties |
| Topic | Description | Reference |
|---|---|---|
| Margin | Margins with spacing scale, negative values, logical properties ( | layout-margin |
| Padding | Padding with spacing scale, logical properties ( | layout-padding |
| Topic | Description | Reference |
|---|---|---|
| Overflow | Controlling how elements handle content that overflows | layout-overflow |
| Topic | Description | Reference |
|---|---|---|
| Object Fit & Position | Controlling how images and video are resized and positioned | layout-object-fit-position |
| Topic | Description | Reference |
|---|---|---|
| Table Layout | border-collapse, table-auto, table-fixed | layout-tables |
| Topic | Description | Reference |
|---|---|---|
| Transform Base | Base transform utilities, hardware acceleration, custom transform values | transform-base |
| Translate | Translating elements on x, y, z axes with spacing scale and percentages | transform-translate |
| Rotate | Rotating elements in 2D and 3D space | transform-rotate |
| Scale | Scaling elements uniformly or on specific axes | transform-scale |
| Skew | Skewing elements on x and y axes | transform-skew |
| Topic | Description | Reference |
|---|---|---|
| Font & Text | Font size, weight, color, line-height, letter-spacing, decoration, truncate, | typography-font-text |
| Text Align | Controlling text alignment with left, center, right, justify | typography-text-align |
| List Style | list-style-type, list-style-position for bullets and markers | typography-list-style |
| Topic | Description | Reference |
|---|---|---|
| Background | Background color, gradient, image, size, position | visual-background |
| Border | Border width, color, radius, divide, ring, block border utilities ( | visual-border |
| Effects | Box shadow, opacity, mix-blend, backdrop-blur, filter, colored drop shadows | visual-effects |
| SVG | fill, stroke, stroke-width for SVG and icon styling | visual-svg |
| Text Shadow | Text shadow sizes, colors, and opacity modifiers (v4.1) | effects-text-shadow |
| Mask | Composable mask utilities with gradient and radial masks (v4.1) | effects-mask |
| Topic | Description | Reference |
|---|---|---|
| Transition & Animation | CSS transitions, animation keyframes, reduced motion | effects-transition-animation |
| Visibility & Interactivity | Visibility, cursor, pointer-events, user-select, z-index | effects-visibility-interactivity |
| Form Controls | accent-color, appearance, caret-color, resize | effects-form-controls |
| Scroll Snap | scroll-snap-type, scroll-snap-align for carousels | effects-scroll-snap |
| Topic | Description | Reference |
|---|---|---|
| Dark Mode | Dark mode with | features-dark-mode |
| Topic | Description | Reference |
|---|---|---|
| Upgrade Guide | Migrating from v3 to v4, all renamed/removed utilities, scale shifts, config migration | features-upgrade |
| Topic | Description | Reference |
|---|---|---|
| Custom Styles | Adding custom styles, utilities with | features-custom-styles |
| Functions & Directives | Tailwind's CSS directives ( | features-functions-directives |
| Content Detection | How Tailwind detects classes, | features-content-detection |
| Topic | Description | Reference |
|---|---|---|
| Utility Patterns | Managing duplication, conflicts, important modifier, when to use components | best-practices-utility-patterns |
@themedark:md:hover:bg-blue-600@theme@utility@custom-variant--breakpoint-3xl: 90rem1440px@custom-variant@variant