3 ms·
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 exa
by GloomyBoots 3y ago
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).
- ameswarb 3y agoThe docs actively discourage you from doing this. https://tailwindcss.com/docs/reusing-styles#avoiding-premature-abstraction https://tailwindcss.com/docs/reusing-styles#avoiding-prematu...
- imilk 3y agoThey 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.