I feel that there has to be a better way.
I feel that there has to be a better way.
It’s not accurate to imply what CSS does is only “managing display preferences”.
CSS is the presentation (color, layout, typography, animation, speech) and state management layer for HTML and SVG, among other markup languages.
I much rather have agreed upon specifications instead of having to invent hacks and work arounds for things that should be standard in 2022.
It took 20+ years to get layout based on columns and rows (CSS Grid); before that, layout comprised of hacks (floats, absolute positioning) and features being misused, like tables.
Container queries, CSS Nesting and the parent selector—-:has()—-results in less and easier to understand code with fewer hacks. It also means doing more without reaching for JavaScript.
CSS is in a good place finally and I for one hope it continues.
I guess the point of my story is that people will misuse tools regardless of what is available to them.
And narrowing the toolset is impossible without dictating terms to others on what tools they don’t get.
One loose analogy is that 99% of stuff in Home Depot I won’t need. But it all makes my walk a bit longer and makes finding stuff harder and there’s probably some tools I didn’t know about that would make my life easier. But should I advocate that a lot of it should be eliminated?
Back in the day, developers would use a CSS framework just to manage grid issues, which had their own limitations.
With CSS Grid, we do things that were difficult or impossible with much less code.