News for hackers. Stuff that matters.
Re:Tailwind Is a Leaky Abstraction by nailer on Tuesday November 29, 2022 @09:34AM (#33788053)
> I love not having to bounce between and cross-reference 2 (or more!) files (HTML + CSS) for a description of a single layout.

Oh wow. Literally this is the exact argument I use for not using tailwind. Not saying either of us is right or wrong it’s just odd how different people perceive things.

Re:Tailwind Is a Leaky Abstraction by pindab0ter on Tuesday November 29, 2022 @09:39AM (#33788124)
How does Tailwind require bouncing between multiple files? Everything is in the HTML in the form of class names.

Yes, you will have to know what the classes do, but where that isn't already intuitive it's just a one-off lookup, and then you know.

HTML + CSS can simply not be parsed without hoping between multiple files. Unless you inline all of your CSS, of course.

Re:Tailwind Is a Leaky Abstraction by eajakobsen on Tuesday November 29, 2022 @09:44AM (#33788196)
I think the point in the comment you are replying to is that they _prefer_ having markup and styles in separate files.
Re:Tailwind Is a Leaky Abstraction by solumunus on Tuesday November 29, 2022 @10:49AM (#33789006)
You can still do that though. I swear half the Tailwind haters haven't used it for more than 30 minutes, or at all.
Re:Tailwind Is a Leaky Abstraction by xigoi on Tuesday November 29, 2022 @04:53PM (#33793887)
Then what's the advantage of Tailwind?
Re:Tailwind Is a Leaky Abstraction by solumunus on Wednesday November 30, 2022 @07:18AM (#33799677)
Standardised and clean CSS syntax. The benefits in that context are debatable, a component based frontend architecture is where it absolutely shines. If you end up using it in that context you won't need to ask this question, it quickly becomes clear that it's the optimal path.
Re:Tailwind Is a Leaky Abstraction by emmacharp on Wednesday November 30, 2022 @09:43AM (#33801371)
What can't pure CSS do here and that Tailwind does ? The CSS syntax is already clean and standardized if you use it properly and don't name every little piece of interface. It is a genuine question, by the way...
Re:Tailwind Is a Leaky Abstraction by xigoi on Wednesday November 30, 2022 @09:54AM (#33801551)
CSS is standardized…
Re:Tailwind Is a Leaky Abstraction by nailer on Tuesday November 29, 2022 @12:45PM (#33790695)
No, I have HTML and CSS in the same component file. I prefer having styling in one place (the CSS inside the component file) rather than two (the HTML of the component and tailwinds’s own postcss files that implement the styles).
Re:Tailwind Is a Leaky Abstraction by jasonjmcghee on Tuesday November 29, 2022 @10:51AM (#33789053)
Fwiw styled and emotion both offer ways to have cash in the same file as html/js
Re:Tailwind Is a Leaky Abstraction by nailer on Tuesday November 29, 2022 @12:49PM (#33790744)
Yep Svelte and Vue do too. It seems like not having CSS in their components is the actual problem many people are trying to make better.
Re:Tailwind Is a Leaky Abstraction by nailer on Tuesday November 29, 2022 @10:54AM (#33789098)
> How does Tailwind require bouncing between multiple files?

You have styling split between the classes and the actual CSS tailwind implements, which every team I know that has used tailwind absolutely does have to look at.

Re:Tailwind Is a Leaky Abstraction by christophilus on Tuesday November 29, 2022 @12:54PM (#33790819)
It's a vocabulary you quickly get used to, and when paired with editor plugins, it's a non-issue in my experience.
Re:Tailwind Is a Leaky Abstraction by diob on Tuesday November 29, 2022 @01:02PM (#33790928)
Yeah, and it's much better than trying to figure out what random class names some dev made up are doing.
Re:Tailwind Is a Leaky Abstraction by nailer on Tuesday November 29, 2022 @04:38PM (#33793694)
I agree that ‘div soup’ is a problem - I’ve seen a lot of react code by new developers that resembles GWT generated DOMs. But ‘div soup’ has other problems too - way over complicated doms are hard to edit and debug - and the problem is better solved by learning CSS basics to avoid all the wrapper divs you see in React apps made by junior front end developers.
Re:Tailwind Is a Leaky Abstraction by nailer on Tuesday November 29, 2022 @04:35PM (#33793663)
Most of the time I know the CSS already I have to convert it to tailwind - and devtools uses the same syntax so (as the article mentions) the abstraction leaks.
Re:Tailwind Is a Leaky Abstraction by 411111111111111 on Tuesday November 29, 2022 @09:39AM (#33788114)
So just to be clear: your argument is that you like to cross reference multiple files before you know what is applied, when?