News for hackers. Stuff that matters.
Re:Why Tailwind CSS Won by nisegami on Wednesday August 16, 2023 @06:52AM (#37145199)
>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 by mablopoule on Wednesday August 16, 2023 @07:01AM (#37145252)
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 by dikei on Wednesday August 16, 2023 @07:20AM (#37145385)
> it can also be quite clean when you use a sane DOM structure, CSS variables, and well thought out CSS selectors.

This fall apart pretty quickly as soon as more developers join the project. Keeping consistency between multiple team members is hard without a reference point, which is what a framework like Tailwind provides.

Re:Why Tailwind CSS Won by tmorton on Wednesday August 16, 2023 @07:09AM (#37145304)
There are many technologies that match this pattern: "While X can be a footgun, it can also be quite clean when you use A, B, and C."

In practice, they don't end up "quite clean" outside small personal projects.

Re:Why Tailwind CSS Won by paleite on Wednesday August 16, 2023 @07:06AM (#37145285)
i think that’s what people’s argument FOR tailwind is: CSS can easily be a footgun, unless everyone on the team uses a sane DOM structure, CSS variables and well thought out CSS selectors.

i’ve yet to witness a project without “!important” scattered throughout the codebase.

Re:Why Tailwind CSS Won by broast on Wednesday August 16, 2023 @07:13AM (#37145331)
That's sad to hear. Good CSS with an intuitive DOM structure is simple to achieve yet so powerful. Hate to see devs give up that power.
Re:Why Tailwind CSS Won by nisegami on Wednesday August 16, 2023 @07:32AM (#37145485)
Complex solutions are much, much easier than simple solutions.
Re:Why Tailwind CSS Won by yurishimo on Wednesday August 16, 2023 @08:19AM (#37145900)
Exactly this. Anyone who has worked with a junior developer understands this intuitively. They spend a week smashing their head against the desk figuring something out, then in review, you (the senior dev) can look at it for 30 seconds and see all the holes they missed and think of a simpler solution that uses 1/3 the amount of code.

Simplicity is a skill and it's hard to do. There's a reason most people are not minimalists despite the almost universal western desire to "have less stuff".

Re:Why Tailwind CSS Won by randomdigitz on Wednesday August 16, 2023 @07:21AM (#37145392)
Tailwind is a means to an end. If you think writing css is the best way to spend your time, go for it. But I guarantee I can ship things faster using Tailwind.
Re:Why Tailwind CSS Won by progx on Wednesday August 16, 2023 @07:29AM (#37145463)
Which things? Individual styled simple elements? Sure. Complex reusable and customizeable components, no way.
Re:Why Tailwind CSS Won by nisegami on Wednesday August 16, 2023 @07:35AM (#37145504)
>DOM structure, CSS variables, and well thought out CSS selectors

Since I graduated university, I haven't worked with anyone who I would trust to achieve one of these three things, let alone all 3. I don't think any of my ~10 coworkers even know what a CSS selector is (they may know how to use the basic three but don't know them as CSS selectors).

Re:Why Tailwind CSS Won by troupo on Wednesday August 16, 2023 @07:08AM (#37145297)
> quite clean when you use a sane DOM structure, CSS variables, and well thought out CSS selectors.

I've yet to see a single project that doesn't fail on all three.

Re:Why Tailwind CSS Won by mablopoule on Wednesday August 16, 2023 @07:34AM (#37145498)
I'm sadly not surprised to hear that, same for another poster who had the displeasure of working with a codebase with !important sprinkled everywhere.

Truth is I've been spoiled on that front because I had the luck to work for many year in a company where the CTO was a very talented dude who lived and breathed HTML/CSS since the mid-2000's, and who was quite thoughtful about that kind of stuff, so I had a first-hand experience of a good codebase, mostly by avoiding external dependencies, using the standard browser behavior, and frequently consulting the MDN.

This is why it's a bit disheartening to see so many front-end framework working against the plateform, even even marketing against it, while CSS and browser tooling his so much more enjoyable and powerful than before.

Re:Why Tailwind CSS Won by troupo on Wednesday August 16, 2023 @10:51AM (#37147984)
So, to have what you have you need a "very talented dude who lived and breathed CSS and HTML".

Technology that makes it easier to make bad decisions than good decisions is not a good technology.

> This is why it's a bit disheartening to see so many front-end framework working against the plateform, even even marketing against it

None of the frameworks I know of do that.

Re:Why Tailwind CSS Won by mablopoule on Wednesday August 16, 2023 @02:04PM (#37151086)
True, but the thing is that it wasn't really "complicated" CSS we used, but simply a good grasp on the fundamental of CSS, which is a overlooked part of web development.

I believe it's mostly due to the fact that CSS, just like SQL, is one of those technology approachable enough to fiddle with it and get somewhat far, while not really learning it, and thus overlooking the fundamentals.

> None of the frameworks I know of do that.

I would squarely put into this category all the CSS-in-JS frameworks, such as 'styled components'. Also everything that markets the 'cascading' part of CSS as being a mistake.

Also, all the frameworks that compiles CSS without generating the CSS sourcemaps, making the debugging experience way less efficient since all the applied CSS rules shows under '<style>' (eg: 'styled-components' again, who discarded it as being 'cosmetic' in the related Github issue).

Re:Why Tailwind CSS Won by marcosdumay on Wednesday August 16, 2023 @09:55AM (#37147058)
I'd say that the "stylesheets" part doesn't apply either.

Tailwind creates "stylesets", and is absolutely powerless to apply them. Quite like WYSIWYG text editors. So, yeah, anybody claiming you are learning CSS by using it doesn't really know CSS. But I disagree, that kind of thing can be useful on certain contexts.