• 0 Posts
  • 10 Comments
Joined 2 years ago
cake
Cake day: July 27th, 2023

help-circle

  • tailwind removes the abstraction that you don’t need, since many people in react tend towards one scoped css file per component with classes for each element anyway

    What abstraction does it remove? In my view, it just adds slightly different abstractions. Instead of knowing an element has a clean block of rules with set meanings, you get a long (potentially grossly formatted/ordered) string of class names that mean the same thing as the CSS properties for the most part, but you’ve gotta learn a new set of aliases for them. If I am working on someone else’s component, one of these scenarios is way easier for me than the other. Even when I worked with TW for a while, I never could really remember a lot of those class names.

    csszengarden is cool but I haven’t seen the html/css split help an end user, or really even me as a developer.

    You may have never refactored or reskinned a site. I have several times. The hardest projects like that were when content and presentation were tightly coupled. Those felt like pulling teeth to get done. important! every time a dev buried a style tag somewhere deep in some (for all intents and purposes) unchangeable Java code… shudder When they were loosely coupled, it was fun and went much easier.

    edit: respect for knowing csszengarden. That site honestly was the first time I learned this principal and saw it applied. I’ve themed several websites over the years so I’ve used the concept myself.



  • I cannot tell if you’re saying tailwind is taking away from useful abstractions or adding to them. I think it’s taking away from them. A whole bunch of class names in the page is opposite to what we were taught and there was a good reason for the lesson: content and presentation should be defined separately. This lends flexibility, readability and accessibility. Tailwind doesn’t help with anything but preventing a breakage in another component/page. To me the reason to value this trade off is that you don’t want devs to “have to care about css” which is a bad sign to begin with. It says “we think the way the web is built is bullshit, so let’s just try to work around that with the latest attempt to make it better”. The web is not bullshit. CSS is beautiful. Embrace the challenge. (Sorry I’m only halfway directing this rant at you)





  • I’ve never quite understood how adding all these HTML classes to a page is supposed to be clean. Just do a decent job of organizing your code and it’s honestly not that hard to keep from breaking styles unexpectedly. This is the part you tell me “well that only works for small projects”. Not really, it works when styles are managed carefully. I’ve worked on fairly large sites with what modern standards would call “bad” css practices and it was fine, we just had an understanding that some devs were frontend (I was lead for a couple years at this particular company I’m thinking of) and some were backend. The backend people botched styles every time so we forbade them eventually. I think that contextless type of “help” is where people get the idea that you have to have a css setup that prevents people from breaking anything unexpectedly. CSS just gets no respect. You wouldn’t let a frontend guy go changing your core backend code so why is the reverse ok?

    I like css modules too but I totally disagree that css is irreparably broken and needs some system that discourages the cascade of styles in all cases.