2 ms·
> Tailwind instead pushes the dev into a CSS-first approach. You think about the Tailwind classes you want, and then throw yet-another-div into the DOM just to
by antran22 5mo ago
> Tailwind instead pushes the dev into a CSS-first approach. You think about the Tailwind classes you want, and then throw yet-another-div into the DOM just to have an element to hang your classes on.
To be fair plopping a `div` everywhere started way before Tailwind. I blame React and the mess that is CSS in JS for this.
- evilduck 5mo agoDivitis was a thing long before React came along. It was a common solution to styling problems even in the jQuery/Dojo days. Getting stuff to look similar across IE6 and FF before CSS3 relied heavily on divs.
- ncphillips 5mo agoIt did for sure. And Tailwind absolutely doesn’t need to be done this way. I think this is a correlation-not-causation issue
- TonyAlicea10 5mo agoI disagree. With Tailwind you think in nested classes which ergonomically encourages “I need a div for this class”. Very similar to early React where every component had to return a single real parent element (now you can return a fragment) so people chose div.