Hacker News new | ask | show | jobs
by LAC-Tech 1367 days ago
Nevertheless, when it appeared on the scene, it was wild: you're going to put the HTML and CSS in the JavaScript? Are you mad?

I still think plain old CSS - separate from any JS or HTML or JS that generates HTML - is the way to go.

Just so much easier and less brittle. I get that CSS being too hard for binary tree inverting geniuses to learn is now widely accepted folk wisdom, but it's really not true.

1 comments

I strongly dislike having all the css for the site in one place because the dependencies are opaque and it’s hard to apply local reasoning. For some CSS that’s what you want, but for a lot of use cases you want very specific rules coupled to very specific DOM. When I have that kind of relationship I want to control the blast radius and not let it leak out to the rest of the app. I also want co-location with the thing that’s making the relevant DOM.

I also do think CSS is hard to learn because of how vast it is with the decades of shit piled on. There’s no clear way to do a lot of things, and if I have a solution, there’s always this doubt that I’m holding it wrong and fucking over future me.

People that know CSS tend to hate things like tailwind and css-in-js because it’s an absolute abuse of the core design principles of “correct” CSS. But these things succeed for not 100% bad reasons.