Re:Tailwind and the Beauty of Ugly Code
by GloomyBoots on Friday July 07, 2023 @01:07AM
(#36627418)
Itβs not an either/or within Tailwind itself. It explicitly allows you to add classes like that using the built in styles using @apply (IIRC buttons are the example used in the docs).
[ Parent
| on HN ]
The docs actively discourage you from doing this.
https://tailwindcss.com/docs/reusing-styles#avoiding-prematu...
They discourage you from doing this wholesale for the good reasons in the link you posted. But it is still highly useful for small elements that are reused across the site.
Plus, I'd assume that almost everyone using Tailwind is going to break their website/app into reusable components - which negates the need to use @apply across the board.