Hacker News new | past | comments | ask | show | jobs | submit login

Why use @apply for this? The classes are already simple and standardized. Now if I want to modify a component style I have to go find the css file with the @apply rule, which is how css normally used to work & kind of defeats the point of Tailwind IMO. I also have to grep the whole codebase and make sure nobody was using `.card-bg` or whatever in an unexpected spot. Plus you have to deal with a mixture of bespoke CSS classes and tailwind ones. Seems like a hassle!



It’s indeed a hassle if you were to mix your own CSS classes and Tailwind, but I don’t do that. Instead I use Tailwind for its design system and set of defaults.

My own CSS is classic BEM style, so very component like.

In hindsight I could easily replace Tailwind and just produce a set of CSS variable as a design system.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: