Incomplete List of Mistakes in the Design of CSS (wiki.csswg.org)
5 years ago from Anselm Urban, German Web Designer and Developer
5 years ago from Anselm Urban, German Web Designer and Developer
My favourites:
Box-sizing should be
border-box
by defaultz-index should be called
z-order
ordepth
and should Just Work on all elements (like it does on flex items).The top and bottom margins of a box should never have been allowed to collapse together automatically as this is the root of all margin-collapsing evil.
This one is an awesome idea but I can't see it ever getting implemented due to absolutely decimating backwards compatibility:
Selectors have terrible future-proofing. We should have split on top-level commas, and only ignored unknown/invalid segments, not the entire thing.
I assume that would mean we could write a selector like .container .box .item p, ul, ol, blockquote
and it'd match all p
, ul
, ol
, and blockquote
elements that were children of the .container .box .item
chain? That sounds so great. Impossible, but so great.
No the comma thing means if one part of the selector was something futuristic that the browser didn’t support, it could still support the other parts. Right now you have to write two distinct rules.
Oh, that's cool. A lot more logical.
Box-sizing should be border-box by default
Yes, yes, yes… yes? YES!
At least it’s an easy fix.
This is easily fixed in the reset * {box-sizing:border-box;}
This stuff makes me dream of Internet 2.0, a magical place where we all start with a clean slate.
It'd probably be chaos incarnate.
This is interesting! What should be done for this to be implemented?
I don't think this could ever be implemented, realistically. Vendors would need to come up with some system so we could instruct browsers to use the correct way of doing things instead of the conventional way. Some of these would be easy, such as "nowrap
vs. no-wrap
" (just support both) but nigh on impossible for stuff like "z-index
should Just Work" without breaking half the internet.
We could have something like a module for PostCSS that enables us to write the correct code and it'd compile to output the production-safe (flawed) code. Though that seems like a bit of a waste of time...
Support both for a while and wait for the natural transition to occurs. Seems possible.
While that would work for simpler things, I think that's a little bit of a naïve view for more complicated stuff, such as z-index
. You know how CSS is... The browser would need to support both sets, and because these rules are frighteningly similar to the old rules, the CSS parser may accidentally parse rules that were written for the flawed way of doing things and think it's for the new way.
The irony of this situation is that the flawed CSS we've all been writing is kind of the reason why this isn't just an overnight patch. Another example would be box-sizing: border-box
which is a great idea but you have to consider all the really old layouts that rely on the old model of box sizing. It would all break down if this change just suddenly happened overnight.
They can photograph light nowadays. This seems quite easy to fix. hahaha
Designer News
Where the design community meets.
Designer News is a large, global community of people working or interested in design and technology.
Have feedback?
Login to Comment
You'll need to log in before you can leave a comment.
LoginRegister Today
New accounts can leave comments immediately, and gain full permissions after one week.
Register now