|
|
|
|
|
by tomjen3
3637 days ago
|
|
Thats because CSS is not powerful enough, not helped that you can't use something like flexbox if you need to support old browsers but even the latest version of $YOUR_BROWSER does not have a way to say that I want a list element to layout its elements in one vertical column that is also centered vertically on the screen if it has fewer elements than there is space for on a screen, but having it split into additional columns and align all elements in all columns to the top if there are more elements than space on the screen. It is a fairly simple layout and I ended up having to do it in JS because flexbox only has a few standard modes for what to do when the content overflows and those don't effect the margins of the element. CSS needs to be replaced with a more capable scripting language, or at least one based on constraints but until that happens we are stuck with javascript. |
|
This kind of objection is totally missing the point.
And this isn't an argument that CSS doesn't have painful limits (it does) or even about what constitutes "enough" (within its limits, CSS offers enough possibilities that your own ideas of what the app "should" be like may be as much as a limit as the problems of CSS are).
The power of CSS is largely orthogonal to the underlying issue.
Ideally, your web site/app is still usable even with every last stylesheet completely ignored. It should work with Lynx, or with entirely non-visual user agents (screenreaders, search bots, Siri etc).
CSS should enhance via layout and other presentation rules where that's possible.
JS should provide more convenient application behavior where that's possible.
Instead, we've slipped into a space where the browser (and, frequently enough, one browser) is simply considered The VM That Lived™, just another runtime target. And that's a sign of its growing power, and that power isn't a bad thing because there are in fact some applications that don't fit the hypermedia model well and the browser's ability to play the just another runtime role opens a space for them. But the rush to get into that space is considerably overdone and apparently executed without a lot of awareness of what's been lost in moving that way.