Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CSS: What‘s New, The Future, and You

CSS: What‘s New, The Future, and You

A look at some recent, forthcoming, and possible future CSS properties. Given at Leetspeak in Stockholm, Sweden, on 12th October 2013.

Peter Gasston

October 12, 2013
Tweet

More Decks by Peter Gasston

Other Decks in Technology

Transcript

  1. selectors li { color: #00F; } ol li { color:

    #F00; } ol.foo li { color: #00F; } ol:not(.foo) li { color: #F00; } http://dev.w3.org/csswg/selectors/
  2. selectors ol span, ul span, p span {…} *:matches(ol,ul,p) span

    {…} http://dev.w3.org/csswg/selectors/
  3. backgrounds E { background-position: right 20% top 0; } E

    { background: url('foo.png') 0 0 / 100% auto; } http://dev.w3.org/csswg/selectors/
  4. flexbox .holder { display: flex; } .child { width: 30%;

    } .child { flex: 1; } .a { flex: 2; } .b { flex: 1; } http://dev.w3.org/csswg/css-flexbox/ a b
  5. “There is no chance that the iPhone is going to

    get any significant market share. No chance.” - Steve Ballmer
  6. intrinsic sizes E:before, E:after { content: ''; display: table; }

    E:after { clear:both; } E { min-height: contain-floats; } http://dev.w3.org/csswg/css-sizing/
  7. Judging the capabilities of a device by the resolution of

    its screen is like judging the height of a person by the colour of their shoes.
  8. media queries http://dev.w3.org/csswg/mediaqueries/ @media (script: 0) {…} @media (hover: 1)

    {…} @media (pointer: coarse) {…} @media (luminosity: dim) {…}
  9. device adaptation http://dev.w3.org/csswg/css-device-adapt/ @viewport { width: 100vw; zoom: 1; }

    <meta name="viewport" content="initial-scale=1, width=device-width">
  10. F { grid-column: 2; grid-row: 2; } grid layout .a

    { grid-column: 1 3; } http://dev.w3.org/csswg/css-grid/ .b { grid-area: 2 2 3 3; }
  11. E { grid-template-areas: 'head head head' 'nav main main' 'foot

    foot foot'; } grid layout http://dev.w3.org/csswg/css-grid/ head head head nav foot foot foot main main
  12. E { grid-template-areas: 'head head head' 'nav main main' 'foot

    foot foot'; } grid layout .a { grid-area: 'head'; } .b { grid-area: 'main'; } http://dev.w3.org/csswg/css-grid/ head head head nav foot foot foot main main b a
  13. regions .a { flow-into: 'foo'; } .b { flow-from: 'foo';

    } http://dev.w3.org/csswg/css-regions/ a b
  14. custom properties :root { var-brand: #F00; } h1 { border-color:

    var(brand); color: var(brand); } http://dev.w3.org/csswg/css-variables/
  15. custom properties :root { var-brand: #F00; } .foo { var-brand:

    #00F; } <style scoped>…</style> http://dev.w3.org/csswg/css-variables/
  16. hierarchy .foo {…} .foo h1 {…} .foo h1 em {…}

    .foo ul {…} .foo {… & h1 {… & em {…} } & ul {…} }
  17. demos • philipwalton.github.io/solved-by-flexbox/ • adobe-webplatform.github.io/regions-adaptive/ • codepen.io/adobe/ NB: You will

    need Chrome Canary for many of these demos, and may have to enable ‘experimental web platform features’ in about:flags.