Live data from Hacker News

I don't recommend Tailwind CSS

en.andros.dev

41–50 of 179 posts

Re: I don't recommend Tailwind CSS

#41
I know complaining about the site is poor form, but it is really hard to take advice seriously for a site that lets other visitors spam... just general internet things to other visitors.

Cute idea, but it is pretty clear the author doesn't consider practical consequences, so why should I trust their judgement about Tailwind?

Re: I don't recommend Tailwind CSS

#42
Tailwind didn't happen by chance - it was the culmination of many other failed philosophies for addressing a problem with CSS when it gets large.

Centrally the problem is this: large CSS requires a lot of active effort to prevent it becoming spaghetti code.

Writing your own CSS can work in solo projects or small projects but Tailwind was designed for large projects, teams and developers with an irrational fear of CSS.

Re: I don't recommend Tailwind CSS

#43
post #29

I see you have a .button, cool! So did you load the entire context of your project into your mind, and calculate every possible iteration of kind, size, color etc this button may have? And once you did that, did you come up with a semantically correct naming scheme that is clear and will not succumb to the inevitable .button_checkout_special_page_cta_widget a particular page will end up requiring? No? Neither did I.…

I feel like scoped css and component libraries fixed this issue. I don’t have a .button, I just have a that has all its css self contained.

And just a shared color definition file.

Re: I don't recommend Tailwind CSS

#44
We already tried the fully semantic web in the days of XHTML, where the document is purely semantics and CSS purely transformation.

It didn't work in practice, because people want to structure their document based on how they expect it to be presented.

My understanding is thay HTML5 was built on the understanding that language purity just went in the way of productive compromise.

Re: I don't recommend Tailwind CSS

#45

I've used a lot of tailwind professionally over the last few years and I agree with this article - it is spot on. I never even use tailwind in my own stuff, even though I think that small devoper-led side-projects are where it is a good fit (and the reason for it's popularity).

I have the opposite experience regarding where it’s useful. In large teams , using an atomic css framework provides good guard rails and predictable behavior. I can confidently copy a marketing page or some random thing on the other side of the company and with very minimal tweaking, it will probably work. With normal CSS, the cascade is much more likely to cause subtle shifts in behavior over time as the main stylesheet is extended and modified.

To be clear, I like css and I find the cascade a great tool, but I also have first hand experienced the pain of too many chefs in the frontend styling kitchen and the havoc that seemingly innocent tweaks here or there can wreak on a site and I prefer tailwind for that reason.

Re: I don't recommend Tailwind CSS

#46
post #29

I see you have a .button, cool! So did you load the entire context of your project into your mind, and calculate every possible iteration of kind, size, color etc this button may have? And once you did that, did you come up with a semantically correct naming scheme that is clear and will not succumb to the inevitable .button_checkout_special_page_cta_widget a particular page will end up requiring? No? Neither did I.…

I feel like scoped css and component libraries fixed this issue. I don’t have a .button, I just have a that has all its css self contained. And just a shared color definition file.

Same, my need for tailwind got completely ridden when I started using Svelte, thanks to the CSS-scoping it entailed.

Re: I don't recommend Tailwind CSS

#47
post #29

I see you have a .button, cool! So did you load the entire context of your project into your mind, and calculate every possible iteration of kind, size, color etc this button may have? And once you did that, did you come up with a semantically correct naming scheme that is clear and will not succumb to the inevitable .button_checkout_special_page_cta_widget a particular page will end up requiring? No? Neither did I.…

You still have to remember what sizes or whatever to use for what to make it consistent, it’s just they get packed into the “class” attribute. It’s not uncommon to see very long class attribute lines with tailwind with all kinds of p-this and mx-that or whatever. I’ve also seen quite a lot of p-[whatever] tags, at which point all the consistency goes out the window.

So you end up wrapping the components (if you’re using react or something similar) so that you can centralise the styles and use a set of consistent components instead. And at that point it really doesn’t matter if you use tailwind, custom classes, per component css modules, style attributes, css-in-js, or what have you. At this point I prefer to drop the extra dependency and use per-component css files with css module imports. (Or when I do less custom styled UI’s, I prefer to use Mantine and use its attributes for layout and styling)

Re: I don't recommend Tailwind CSS

#48
It’s funny how, upon opening the website, you’re immediately greeted with a “Was Top 1 on Hacker News” link leading back here, but (at time of writing) it has under 50 points and almost every comment disagrees with the post.

While I don’t really have a strong opinion on Tailwind CSS, I do have a strong negative reaction to websites who advertise to everyone how many people are on the page, especially when that’s shoved in our faces and people can send malware links and spam to everyone else (as is happening in droves).

Re: I don't recommend Tailwind CSS

#49
I tried to use Tailwind in a hobby project couple years ago. I havn't updated my CSS skills since 2010 or 2015 -- I certainly missed grid layout and some other new features.

Quickly, I realized Tailwind is documented on top on CSS, no way around. This makes you keep in mind both.

No idea why is Tailwind even a thing.

Re: I don't recommend Tailwind CSS

#50
if you don't like this.

  .button {
      @apply py-2 px-4 bg-indigo-500 text-white font-semibold rounded-lg hover:bg-indigo-700 focus:bg-indigo-700;
  }

why not write it like this?

  .button {
    @apply
      py-2
      px-4
      bg-indigo-500
      text-white
      font-semibold
      rounded-lg
      hover:bg-indigo-700
      focus:bg-indigo-700
    ;
  }
Post reply on HN