3 ms·
There's a missing feature. Look at a css page and know how the site will behave. Every programing language you look at code (if well written) and u know what it
by hornet-run 7y ago
There's a missing feature. Look at a css page and know how the site will behave. Every programing language you look at code (if well written) and u know what it will do. In css you know what are the attributes set but it doesn't really tell you what is going you happen. That's the only thing I don't like in css.
- Sahhaese 7y agoThis 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.
- rawTruthHurts 7y ago> Every programing language you look at Isn't the point of CSS that it's not a programming language? It's just a list of properties, after all.
- yoz-y 7y agoWhat layout system/language would work in a readable manner? To me layout is basically a way to express a set of constraints which can be sometimes contradictory. In CSS a problem rises because the system will always manage to resolve them, somehow, and there are no warnings. LaTeX or AutoLayout will help you write an unambiguous layout, but they are still inscrutable at a glance.
- Raphmedia 7y agoCSS is a list of declarations. There is nothing esoteric about it. You can read it from top to bottom and understand what the defined styles will look like when they are rendered. If your naming is done correctly and your files are separated by features, there is no reason why you can't understand and visualize everything that is defined.