4 ms·
This is the killer reason why I hate doing anything with CSS. There's close to zero predictability. CSS has no isolation / encapsulation, no control flow and n
by Sahhaese 7y ago
This is the killer reason why I hate doing anything with CSS. There's close to zero predictability.
CSS has no isolation / encapsulation, no control flow and no local state. Every line of code can modify and affect every other line. And even then, what happens is then dependent on an independently defined DOM object.
Yes, it's possible to write CSS in a way that helps ease the problems that the missing features above cause, but that's working harder to work around the language.
The raison d'etre of CSS, "style independently of the semantic document" is a failed project. It works for DOM trees that can be legitimately considered documents but fails horribly for what can be considered 'applications'. For that reason, I think an overhaul of web document styling is much needed.
The purists will cry that most of what is delivered on the web are "applications" and not "documents", especially when it comes to the morning news, but pretending that isn't the case isn't helpful.
- rimliu 7y agoMaybe web tech for applications is the failed project, not the CSS.
- goatlover 7y ago> It works for DOM trees that can be legitimately considered documents That's because this is what the web was built for. But then everyone wanted to turn it into an application platform by building on top of a document model. Of course CSS was designed to style documents.
- hkai 7y agoMany people heard your pain so this is why in Vue.js CSS is isolated, while in react you can use styled components for encapsulation, sort of.