4 ms·
> 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 e
by nailer 4y ago
> 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 having my styling logic split between classes in my HTML and tailwind’s own files implementing the styles (which appears in DevTools and most other places).
Not saying either of us is right or wrong it’s just odd how different people perceive things.
Does your framework do CSS in it’s component files? If not, maybe that’s the problem?
- 411111111111111 4y agoSo just to be clear: your argument is that you like to cross reference multiple files before you know what is applied, when? And for the record, tailwind was never meant to be used exclusively. Most arguments against it are centered around edge cases which are tiresome with tailwind... But they're usually pretty silly as you were never meant to abstain from using css if it makes sense. And yes, that means you'll still have to check multiple files if something behaves differently then you'd expect, it's just less frequent then without a utility css framework
- pindab0ter 4y agoHow 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.
- eajakobsen 4y agoI think the point in the comment you are replying to is that they _prefer_ having markup and styles in separate files.
- solumunus 4y agoYou can still do that though. I swear half the Tailwind haters haven't used it for more than 30 minutes, or at all.
- xigoi 4y agoThen what's the advantage of Tailwind?
- solumunus 4y agoStandardised 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.
- nailer 4y agoNo, 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).
- jasonjmcghee 4y agoFwiw styled and emotion both offer ways to have css in the same file as html/js
- nailer 4y agoYep 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.
- nailer 4y ago> 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.
- christophilus 4y agoIt's a vocabulary you quickly get used to, and when paired with editor plugins, it's a non-issue in my experience.
- diob 4y agoYeah, and it's much better than trying to figure out what random class names some dev made up are doing.
- nailer 4y agoI 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.
- nailer 4y agoMost 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.