Five best practices for preventing chaos in Tailwind CSS. Nina Torgunakova argue...

@webstandards_dev@mastodon.social

Five best practices for preventing chaos in Tailwind CSS. Nina Torgunakova argues utility-first styling scales only on top of a design system and component architecture. Cut class noise with shorthands like py-4, define semantic tokens once in @​theme or tailwind.config.js, and automate ordering with the official Prettier plugin. Expose fixed component variants instead of arbitrary classes through props. Tailwind 4 minifies automatically, 3 needs --minify. #css #tools

evilmartians.com/chronicles/5-