Live data from Hacker News

Why Tailwind CSS Won

matt-rickard.com

141–150 of 559 posts

Re: Why Tailwind CSS Won

#141

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…

His first point is the same as your first point?

Re: Why Tailwind CSS Won

#142

I always felt slightly dirty after writing a bit of inline CSS (`style=”color: red“`) instead of a proper class, yet at the same time it accomplishes the goal and it was fast. So this is basically Tailwind, right?

Another aspect is css class reuse. Inline styles are not preprocessed so each inline style is a 1:1 increase in bundle size. In large applications this can be significant. Imagine having hundreds of popups each with 50 lines of css. It adds up.

Re: Why Tailwind CSS Won

#143
post #79

Earlier quoted context omitted.

Hopefully your link will be a component, so you only need replace one line anyway. Then again if your styles are abstracted to a component, your CSS framework is irrelevant!

Why would you use a component for something that's already a built-in HTML element?

One example is if I was using react it would be used to encapsulate a react-router Link and an anchor tag in a component, and use props to differentiate between inbound and outbound links.

Re: Why Tailwind CSS Won

#144
post #53

Earlier quoted context omitted.

Do you also use De Bruijn indices when programming so you don't have to name variables?

When I program I make all my variables global and name them with BEM to get the same great experience as in vanilla CSS.

BEM is not a part of vanilla CSS, it's just a naming convention that you may or may not use.

Re: Why Tailwind CSS Won

#145
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_,…

>You're not learning anything valuable by learning Tailwind. Learn CSS, that will stick with you for the next 20 years.

Tailwind maps onto CSS in a very straightforward way. I think you'd have to go out of your way to "learn Tailwind" without also improving your knowledge of CSS.

Re: Why Tailwind CSS Won

#146

Silly premise and vapid article. Tailwind 'won' in the same way Bootstrap 'won', i.e. it was popular for a time. $10 says Tailwind will be the Bootstrap of 2027.

Well also bootstrap "died" in the most honorable way possible, it got antiquated by the CSS standard implementing flex and grids (the original specification was based on XUL though and not bootstrap - https://medium.com/@BennyOgidan/history-of-css-grid-and-css-... ) Kind of the same with jquery (although it took quite a lot of new stuff...) I feel like Tailwind won't get that

Yeah the Bootstrap story is hardly one of the frontend world changing tastes, it was the standard forever and everything else at the time was copying it. Some key fundamentals of how CSS is written in the 2020s changed quite a bit as did how people wrote HTML (as the author alludes to using smaller component UIs with build systems replaced big HTML files and big CSS files). It was good time for a rethink IMO.

Components UI systems are not going away, even as we move back to static heavy sites and minimizing JS where ever possible.

Re: Why Tailwind CSS Won

#147
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_,…

>You're not learning anything valuable by learning Tailwind. Learn CSS, that will stick with you for the next 20 years. Tailwind maps onto CSS in a very straightforward way. I think you'd have to go out of your way to "learn Tailwind" without also improving your knowledge of CSS.

Except for the whole "Cascading" part.

I think I understand tailwind, but like the parent poster I'm really not a fan, because while CSS can be a footgun, it can also be quite clean when you use a sane DOM structure, CSS variables, and well thought out CSS selectors.

Re: Why Tailwind CSS Won

#148
post #36
post #26

Once again, the "write once lots of small websites" people and the "maintain huge web apps" people, will be talking past each other. We share a base layer in HTML, CSS, JS, but the incentives, requirements, job environments, team sizes, couldn't be more different. I wonder about other languages and ecosystems. What would be a similar situation for e.g. C? Is there such a thing?

Well, the reason those web apps are huge might not be what you think.

Ok, and what do we do with the apps that are huge because of the reason I think?

Re: Why Tailwind CSS Won

#149
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_,…

You should really understand the CSS rules anyway (e.g. the C means cascading for a reason) so you can at least know what Tailwind is doing for you.

Re: Why Tailwind CSS Won

#150
post #134

Earlier quoted context omitted.

If you know the convention it's quite easy. I don't know Tailwind but with Bootstrap it would be m = margin, y = y axis, b = bottom, sm/lg = screen size, 4/5/6 = size

4/5/6 what? Bananas? And what exactly is “screen size”? Does it refer to physical size, or number of pixels? Does it count width, height, or both?

These refer to customizable variables and breakpoints that everyone using the library and having done css would know and you can probably click on your IDE to get to their definition.

Personally I think that's way better than putting padding & margin in your own css classes.

It actually cuts down a lot on the custom css you need to write and also helps having a uniform design.

Post reply on HN