Friday, 2 May 2014

List of Mistakes in the Design of CSS

List of mistakes


  • white-space: nowrap should be white-space: no-wrap
  • vertical-align should not apply to table cells. Instead the CSS3 alignment properties should exist in Level 1.
  • vertical-align: middle should be text-middle because it's not really in the middle.
  • Percentage heights should be calculated against fill-available rather than being undefined in auto situations.
  • Table layout should be sane.
  • Box-sizing should be border-box by default.
  • background-size with one value should duplicate its value, not default the second one to auto.
  • z-index should be called z-order or depth and should Just Work on all elements (like it does on flex items).
  • word-wrap should have been called overflow-wrap from the beginning because it confuses everybody.
  • 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.
  • Partial collapsing of margins instead of weird rules to handle min/max-heights?
  • Tables (and other non-blocks, e.g. flex containers) should form pseudo-stacking contexts.
  • The currentcolor keyword should have a dash, current-color.
  • There should have been a predictable color naming system instead of arbitrary X11 names.
  • border-radius should have been border-corner.
  • Absolutely-positioned replaced elements should stretch when opposite offset properties (e.g. left+right) are set, instead of being start-aligned.
  • The hyphens property should be called hyphenate. (It's called hyphens because the XSL:FO people objected to hyphenate.)
  • rgba() and hsla() should not exist, rgb() and hsl() should have gotten an optional fourth parameter instead (and the alpha value should have used the same format as R, G, and B or S and L).
  • descendant combinator should have been » and indirect sibling combinator should have been ++, so there's some logical relationships among the selectors' ascii art

No comments:

Post a Comment