Live data from Hacker News

I don't recommend Tailwind CSS

en.andros.dev

31–40 of 178 posts

Re: I don't recommend Tailwind CSS

#32
This is written from a point of view of somebody who never went through the progression of CSS to CSS preprocessors to component-based frontend libraries. Tailwind is an answer to all the problems that become apparent in CSS in that progression.

Re: I don't recommend Tailwind CSS

#33
Coming from Qml, reading css/html is mind numbingly hard.. Haven't seen any other come even remotely close to the readability of Qml. I am talking generic UI development, not just for browsers.

15 years and I thought someone would have by now the neat syntax that Qml has.

If anyone knows an alternative, do tell. Very much looking forward to it.

Re: I don't recommend Tailwind CSS

#34
post #7

As a 26+ year frontender, years ago I was against it on so many levels. Until I tried it. Never looked back. Also, inheriting projects with someone else’s code is fine. Just a quick look at the central config and you’re good to go.

Tailwind looks bad on "paper". It violates a lot of "best practices". It is ugly. Yet in reality it works. It gets the job done. It is fast to work with. Constraints are known to enhance creativity.

IMO this is one of those things where theory meets practice. Theoretical coders (i.e. those who love the code itself, rather than how well it works for the end user) tend to hate on Tailwind, while those who prioritize end user value over code perfection tend to like Tailwind.

Re: I don't recommend Tailwind CSS

#35
Show me one non-trivial project with classic, well-organized CSS usage and clean semantic HTML. It just never works out. There were attempts like BEM, which looks promising at first sight but is awkward at some points and only works if all devs strictly follow the convention. We all know how this usually works out. I once was that semantic HTML and css classes guy too, I completely changed my mind. In the end, we want to efficiently build a clean and shiny website. No real user looks into the (unminified) HTML source code to appreciate those awesome, sophisticated semantic CSS classes.

Re: I don't recommend Tailwind CSS

#36
post #10

This is such a bikeshedding debate. While you don't recommend it, projects with Tailwind work . Over years. You can onboard new developers to it, able to contribute productively immediately . Likewise, you can pick up work after months or years and don't have to remember or rediscover how your styling layer works. The conventions and class names come really naturally fast, and you can always look it up. It's just not…

I can see this argument both ways. On the one hand, logically you'd expect the last assignment to take precedence, like the style attribute. On the other, conflicting styles don't make sense. The random outcome, entirely dependent on the Tailwind generation internals, is the worst of all worlds though, it's just an unfortunate side-effect of relying on cascading sheets to drive atomic styles.

It’s random sure, but it’s also reliably random. This is one of the few footguns that exist in tailwind and luckily it’s super easy to catch. The IDE plugins will give you a warning if you apply multiple classes that manipulate the same attribute and there is no reason you also can’t catch it in CI.

Is it ideal? I guess not, but there are a lot of weird gotchas and footguns in CSS too. Just because they’re in the language doesn’t make them magically more or less of a problem. For a similar weird mental shift, consider adding @starting-style and the native popover open attribute. All the good tutorials online have a warning about cascade order because as a human reading it, it can seem wrong or backwards.

Kevin Powell’s most recent video about animating display: none covers it if you want a concrete example.

Re: I don't recommend Tailwind CSS

#38
Strongly disagree with the point of not learning CSS. Bootstrap and the sorts that were en vogue before were terrible abstractions.

All the mental models required to be good at writing proper stylesheets are trained nicely with Tailwind

Re: I don't recommend Tailwind CSS

#40
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.…

Yes. Bootstrap and all other CSS frameworks before Tailwind did it, too.

It's a matter of preference, but many times it's easier to have single classes so that all your buttons are consistent.

People should just use the tool they're more productive with.

Post reply on HN