11 comments

  • Ed AdamsEd Adams, 5 years ago (edited 5 years ago )

    My favourites:

    Box-sizing should be border-box by default

    z-index should be called z-order or depth 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.

    3 points
    • Patrick SmithPatrick Smith, 5 years ago

      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.

      0 points
    • Marc EdwardsMarc Edwards, 5 years ago

      Box-sizing should be border-box by default

      Yes, yes, yes… yes? YES!

      At least it’s an easy fix.

      0 points
  • Dirk HCM van BoxtelDirk HCM van Boxtel, 5 years ago

    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.

    0 points
  • Pedro Ivo HudsonPedro Ivo Hudson, 5 years ago

    This is interesting! What should be done for this to be implemented?

    0 points
    • Ed AdamsEd Adams, 5 years ago (edited 5 years ago )

      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...

      0 points
      • Pedro Ivo HudsonPedro Ivo Hudson, 5 years ago

        Support both for a while and wait for the natural transition to occurs. Seems possible.

        0 points
        • Ed AdamsEd Adams, 5 years ago (edited 5 years ago )

          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.

          0 points