Live data from Hacker News

Why Tailwind CSS Won

matt-rickard.com

381–390 of 559 posts

Re: Why Tailwind CSS Won

#381

Earlier quoted context omitted.

Just checking that I understand your suggestion: it’s that you copy/paste Tailwind into a file called “designsystem.css” and then say that you are not using Tailwind? Or are you saying take their design system and use your own syntax for it (so it’s less complete than TW, less well-documented, and less transferable to/from the vast resources of the internet centered around TW)?

I'm talking about the design aesthetics included in Tailwind as default. Keep the values and the names if you want. Like this, for example: "blue-500" becomes --blue-500. That's it. This is a far cry from using Tailwind as a whole while keeping the good-looking aesthetics.

> "blue-500" becomes --blue-500. That's it.

Of course it's not "it".

Now in every class that needs it, you also need to add

  {
    ... other styles...
    background-color: var(--blue-500);
  }
And then you need to apply that class

Re: Why Tailwind CSS Won

#383
post #140

Gray beard's 5c: Tailwind is a farce and a catastrophe. It's as modern as the style parameter is, and it's as reusable as a moving a dirt pile from one corner to the next. You're not learning anything valuable by learning Tailwind. Learn CSS, that will stick with you for the next 20 years. It amuses me when a library is implemented 'with tailwind', which means it's totally useless to the people _not using tailwind_,…

Cool hot-take but it’s not true. You’re literally learning CSS when you learn tailwind. And no one (good) picks up a tool solely because it’s shiny, they pick it up because they find it has utility, which evidently LOTS of people do. And if you don’t think it’s reusable then you at least need to bring an argument for why that’s so because the docs, personal anecdote, and the opinion of LOTS of people is completely op…

I vehemently disagree. When you're using tailwind, you're learning Tailwind, which is using CSS in absolutely the unequivocally anti-CSS way.

CSS was meant to cascade; it's what the damn 'C' stands for, and if you cannot understand the efficiency of the cascade, at scale, you are most definitely missing the entire point of CSS.

I have personally built ui libraries for boutique firms and enterprise (Apple) firms and guess what we did _not_ use in any of those instances? Tailwind. Because it's an utter toddler to manage and very definitely not efficient in its application.

Re: Why Tailwind CSS Won

#384

Earlier quoted context omitted.

> If you know the convention it's quite easy. This is exactly the problem. Humans write code for humans, not for tailwind specialists and bots. It should be clear and easy to read unless there is a valid reason for weird code (optimisations, hacks that don't work otherwise etc). Tailwind introduces yet another convention where it is absolutely pointless to do so.

But isn’t BEM or a custom system of CSS variables strictly worse in this regard? Instead of knowing what class=“mb-4” means in Tailwind, they now need to know what class=“news-button” means in your specific application.

class="news-button" means that it's a news button and will be styled the way that news buttons are styled. What's difficult about that?

Re: Why Tailwind CSS Won

#385

I love tailwind, and I've been writing CSS professionally since CSS2.1. I have often debated with many developer friends why it has performed so well, and this article really missed some big reasons: 1. It's works extremely well with the current component-focused UI frameworks (react, svelte, etc). Subsequently, the verboseness that is often a complaint isn't an issue at all, but a feature. 2. Does everything out of…

About point #3, I'd just like to point out that CSS layers exist.

Re: Why Tailwind CSS Won

#386
post #140

Gray beard's 5c: Tailwind is a farce and a catastrophe. It's as modern as the style parameter is, and it's as reusable as a moving a dirt pile from one corner to the next. You're not learning anything valuable by learning Tailwind. Learn CSS, that will stick with you for the next 20 years. It amuses me when a library is implemented 'with tailwind', which means it's totally useless to the people _not using tailwind_,…

> It's as modern as the style parameter is, and it's as reusable as a moving a dirt pile from one corner to the next.

For most uses, the only thing really wrong with the style attribute is the lack of breakpoints for responsive layouts.

Re: Why Tailwind CSS Won

#387
post #74

Earlier quoted context omitted.

It happens pretty often. I change the style of my websites this way all the time.

Ok, sure. But that's not what you were saying in the comment I responded to.

Because you moved the goalposts. First you said that it “almost never” happens, then that it “won't actually happen”.

Re: Why Tailwind CSS Won

#388
post #326
post #304

Earlier quoted context omitted.

Senior Staff grey beard: Counterpoint: The C in CSS stands for Cascading. So you’re not learning CSS. You’re learning Tailwind specific classnames that expand to non-cascading style rules.

the cascade has as many benefits as it has drawbacks, few people like to juggle specificities. IMHO the only important application of the cascade is in its original purpose: custom user defined stylesheets (today often via browser extension or adblockers), but you can add proper descriptive attributes to your markup for them.

In today's uses, cascade _with_ custom properties (the vars defined within :root ) are powerful and are what I leverage when providing theme-able ui libraries. Dark mode, light mode, large mode can all be solved using custom properties which to me most exemplify the power of the cascade.

Re: Why Tailwind CSS Won

#389

Earlier quoted context omitted.

I'm not sure I fully agree with your view on what tailwind is and why it is growing. In my opinion, tailwind is gaining some popularity because some people find it faster and easier to use than writing traditional CSS files. I realise it also has some downsides, and seeing all those class names in the html is particularly ugly, but if the people using it got their project out faster, then surely there is a place for…

Technology choices, and life's choices in general are like a spectrogram of different wavelengths with positive and negative values... Like "this will help you today, but bite you in the rear tomorrow", or "this will help you tomorrow, but be annoying today". And it also varies by different conditional developments, if this happens, if that happens, can you implement a change, or the solution is "write-only" and so o…

What makes you think tailwind would be hell in the future though? It's just a load of classes on html elements. Maintenance is pretty easy.

I do agree with you on the headline though, of course tailwind hasn't won anything!

Re: Why Tailwind CSS Won

#390
post #140

Gray beard's 5c: Tailwind is a farce and a catastrophe. It's as modern as the style parameter is, and it's as reusable as a moving a dirt pile from one corner to the next. You're not learning anything valuable by learning Tailwind. Learn CSS, that will stick with you for the next 20 years. It amuses me when a library is implemented 'with tailwind', which means it's totally useless to the people _not using tailwind_,…

Web technologies like this take hold because they make producing something more attainable to a wider group of people. Who cares if it's "worse".

I'm a backend developer, who works mostly in python. I'm probably never going to learn CSS but I can produce a user interface that looks like I'm competent by copy-pasting tailwind divs. In 5 years, I'll hire someone who knows CSS to fix it. It'll be cheap because webflow and squarespace are allowing graphic designers to build websites, which is squeezing the demand for CSS as a skill.

Post reply on HN