by shubhamjain · 4y ago · 0 comments
While I agree, sometimes I feel Tailwind users forget that writing regular CSS is also an option. I have seen examples where developers repeat Tailwind classes for every paragraph, every link. They repeat same typography styles over and over again instead of creating some base CSS. A great example is this checkbox[1] where developers used 71 Tailwind classes to style the input.
[1]: https://twitter.com/hovhaDovah/status/1461672155108806658
I style things normally in CSS with exceptions or one-offs that are styled in tailwind classes. Usually try to avoid those.
> Confession: The `apply` feature in Tailwind basically only exists to trick people who are put off by long lists of classes into trying the framework
> You should almost never use it
> Reuse your utility-littered HTML instead.
[0]: https://twitter.com/adamwathan/status/1226511611592085504
I've moved to using @apply in a few generalized classes and I love it, since my class names like "btn" "btn-success" "btn-success-outline" describes what I want, and I can easily go in and change them.
I'm not creating a new component for every tiny thing, like a button or a link, just so I can avoid using @apply...