tailwindcss-best-practices

Installation
SKILL.md

Tailwind CSS v4.x Best Practices

Covers 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.

Tailwind CSS is a utility-first CSS framework. Instead of writing custom CSS, you compose designs using utility classes directly in your markup. Tailwind v4 introduced CSS-first configuration with @theme variables, @utility for custom utilities, and @custom-variant for custom variants — replacing the old tailwind.config.js approach entirely.

Critical v4 Migration Gotchas

These are the most common mistakes when working with Tailwind v4. If you're migrating from v3 or using v4 for the first time, read the upgrade guide — but here are the top trip-ups:

v3 (old) v4 (correct) Why it changed
!bg-red-500 bg-red-500! Important modifier moved from prefix to suffix
bg-opacity-75 bg-red-500/75 Opacity modifiers removed; use slash syntax on the color
shadow shadow-sm Shadow scale shifted down one step
shadow-sm shadow-xs Shadow scale shifted down one step
rounded rounded-sm Border radius scale shifted down one step
rounded-sm rounded-xs Border radius scale shifted down one step
ring ring-3 Default ring width changed from 3px to 1px
Related skills
Installs
21
GitHub Stars
2
First Seen
Mar 28, 2026