TailwindCSS, just be good

2 min read

I’ve been frustrated by some of the marketing/rhetoric of TailwindCSS. This blog post by Tero Piirainendoes a good job of highlighting some of the concerns I have. The post includes one of my pet peeves: Reusing Styles from the TailwindCSS documentation strongly encourages options that are not using TailwindCSS in its most verbose syntax:

  • Use multi-cursor editing. (I can’t get over how limited this solution truly is.)
  • Write loops. (Because you hadn’t thought of using loops before.)
  • Create components/partials. (So you don’t see the fact that you’re repeating the same thing over and over unless you do a view source on the output, and now you need to maintain a component where a traditional CSS class would have been OK)
  • Extracting classes with @apply == is bad. This one boggles my mind the most though. Essentially, do anything in your power to not bundle CSS classes together into a reusable CSS bundle. The logic there is mind-bending. “Your CSS bundle will be bigger.” 😬 Really? How much larger was the HTML?

In the spirit of keeping this short, I’ll post again in a few more days about this. :)

  • I do like the TailwindCSS component library DaisyUI
  • Having used UnoCSS, I think UnoCSS is a better implementation of the spirit of atomic utility classes (and it has a compatibility package for TailwindCSS)

Have you tried TailwindCSS? What’s been your approach to maintenance and componentization?