Slide 1

Slide 1 text

CSS: WHAT’S NEW, THE FUTURE, AND YOU. #leetspeak 10/13

Slide 2

Slide 2 text

PETER GASSTON @stopsatgreen broken-links.com

Slide 3

Slide 3 text

CREATIVE TECHNOLOGIST / FRONT-END LEAD rehabstudio.com

Slide 4

Slide 4 text

CSS. Important note: cigarettes are not cool.

Slide 5

Slide 5 text

“When can we use them?”

Slide 6

Slide 6 text

WHAT’S NEW.

Slide 7

Slide 7 text

viewport width (vw) viewport height (vh)

Slide 8

Slide 8 text

E { height: 50vh; width: 80vw; } E { height: 50vh; width: 80vw; }

Slide 9

Slide 9 text

selectors E { width: calc(100% - 40px); } http://dev.w3.org/csswg/selectors/

Slide 10

Slide 10 text

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/

Slide 11

Slide 11 text

selectors ol span, ul span, p span {…} *:matches(ol,ul,p) span {…} http://dev.w3.org/csswg/selectors/

Slide 12

Slide 12 text

backgrounds E { background-position: right 20% top 0; } E { background: url('foo.png') 0 0 / 100% auto; } http://dev.w3.org/csswg/selectors/

Slide 13

Slide 13 text

E { position: sticky; top: 0; } positioning

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

flexbox .child { align-items: center; justify-content: center; } http://dev.w3.org/csswg/css-flexbox/ .parent { display: flex; } .input { flex: 1; } .btn {…}

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

intrinsic sizes E { width: min-content; } http://dev.w3.org/csswg/css-sizing/ E { width: fit-content; }

Slide 18

Slide 18 text

THE FUTURE.

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

Predictions are for idiots.

Slide 21

Slide 21 text

“There is no chance that the iPhone is going to get any significant market share. No chance.” - Steve Ballmer

Slide 22

Slide 22 text

iOS :-) Windows Phone :'-(

Slide 23

Slide 23 text

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/

Slide 24

Slide 24 text

selectors … label /for/ input {…} http://dev.w3.org/csswg/selectors/

Slide 25

Slide 25 text

selectors E! > F {…} http://dev.w3.org/csswg/selectors/ the subject indicator bang!

Slide 26

Slide 26 text

fast vs. complete

Slide 27

Slide 27 text

selectors E! > F {…} http://dev.w3.org/csswg/selectors/ document.querySelector('E! > F');

Slide 28

Slide 28 text

selectors E:link {…} E:any-link {…} E:local-link {…} http://dev.w3.org/csswg/selectors/

Slide 29

Slide 29 text

selectors E:active-drop {…} E:invalid-drop {…} E:valid-drop {…} http://dev.w3.org/csswg/selectors/

Slide 30

Slide 30 text

selectors E:current {…} E:past {…} E:future {…} http://dev.w3.org/csswg/selectors/

Slide 31

Slide 31 text

E { overflow: pages-x; } overflow http://dev.w3.org/csswg/css-overflow/ E { overflow: hidden; }

Slide 32

Slide 32 text

E { overflow: fragments; } overflow http://dev.w3.org/csswg/css-overflow/ E::nth-fragment(odd) {…}

Slide 33

Slide 33 text

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.

Slide 34

Slide 34 text

media queries http://dev.w3.org/csswg/mediaqueries/ @media (script: 0) {…} @media (hover: 1) {…} @media (pointer: coarse) {…} @media (luminosity: dim) {…}

Slide 35

Slide 35 text

conditionals @supports (height: 1vh) {…} http://dev.w3.org/csswg/css-conditional/

Slide 36

Slide 36 text

device adaptation http://dev.w3.org/csswg/css-device-adapt/ @viewport { width: 100vw; zoom: 1; }

Slide 37

Slide 37 text

Good news for designers.

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

grid layout http://dev.w3.org/csswg/css-grid/ E { display: grid; grid-template-columns: 1fr 1fr 2fr; grid-template-rows: 10em auto 40px; }

Slide 40

Slide 40 text

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; }

Slide 41

Slide 41 text

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

Slide 42

Slide 42 text

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

Slide 43

Slide 43 text

fonts http://dev.w3.org/csswg/css-fonts/ E { font-kerning: normal; font-variant-caps: small-caps; }

Slide 44

Slide 44 text

E { content: icon; icon: url('foo.png'); } user interface http://dev.w3.org/csswg/css-ui/

Slide 45

Slide 45 text

E { background-image: image('foo.svg#xywh=0,0,200,120'); } images http://dev.w3.org/csswg/css-images/

Slide 46

Slide 46 text

E { background-image: image('foo.svg#xywh=0,0,200,120'); } images http://dev.w3.org/csswg/css-images/

Slide 47

Slide 47 text

E { background-image: image('foo.svg','foo.png',#F00); } images http://dev.w3.org/csswg/css-images/

Slide 48

Slide 48 text

E { background-image: image-set( 'foo.png' 1x, 'foo-hi.png' 2x, 'foo-print.png' 600dpi, ); } images http://dev.w3.org/csswg/css-images/

Slide 49

Slide 49 text

#a { background: element(#b); } images http://dev.w3.org/csswg/css-images/ a b b a + =

Slide 50

Slide 50 text

E { background-image: conic-gradient(#000,#FFF,#000); } images http://dev.w3.org/csswg/css-images/

Slide 51

Slide 51 text

images E { background-image: cross-fade(50%, 'foo.png', 'bar.png'); } http://dev.w3.org/csswg/css-images/

Slide 52

Slide 52 text

images E { background-image: cross-fade(50%, 'foo.png', 'bar.png'); } http://dev.w3.org/csswg/css-images/

Slide 53

Slide 53 text

E { color: hwb(180deg,50%,75%,1); } color http://dev.w3.org/csswg/css-color/

Slide 54

Slide 54 text

E { color: gray(75%,1); } color http://dev.w3.org/csswg/css-color/

Slide 55

Slide 55 text

E { color: device-cmyk(1,1,0.5,0,1); } color http://dev.w3.org/csswg/css-color/

Slide 56

Slide 56 text

E { color: color(blue (s + 10%)); } color http://dev.w3.org/csswg/css-color/

Slide 57

Slide 57 text

ADOBE.

Slide 58

Slide 58 text

E { filter: blur(2px) grayscale(0.5); } filters http://dev.w3.org/fxtf/filters/

Slide 59

Slide 59 text

filters http://dev.w3.org/fxtf/filters/ @filter foo { src: url('simple2.vs') format('x-shader/x-vertex'); } E { filter: custom(foo); }

Slide 60

Slide 60 text

blending E { mix-blend-mode: multiply; } http://dev.w3.org/fxtf/compositing-1/

Slide 61

Slide 61 text

blending E { background-blend-mode: difference; } http://dev.w3.org/fxtf/compositing-1/

Slide 62

Slide 62 text

masking E { mask-image: url('foo.png'); } http://dev.w3.org/fxtf/masking/ + =

Slide 63

Slide 63 text

masking E { clip-path: circle(50%,50%,200px); } http://dev.w3.org/fxtf/masking/

Slide 64

Slide 64 text

masking E { clip-path: circle(50%,50%,200px); } http://dev.w3.org/fxtf/masking/

Slide 65

Slide 65 text

regions .a { flow-into: 'foo'; } .b { flow-from: 'foo'; } http://dev.w3.org/csswg/css-regions/ a b

Slide 66

Slide 66 text

regions http://dev.w3.org/csswg/css-regions/ .b, .c, .d { flow-from: 'foo'; } c b d

Slide 67

Slide 67 text

exclusions http://dev.w3.org/csswg/css-exclusions/ E { position: absolute;

Slide 68

Slide 68 text

exclusions http://dev.w3.org/csswg/css-exclusions/ E { position: absolute; wrap-flow: both; }

Slide 69

Slide 69 text

shapes http://dev.w3.org/csswg/css-shapes/ E { shape-outside: circle(50%,50%,400px); } E { shape-inside: circle(50%,50%,800px); }

Slide 70

Slide 70 text

YOU.

Slide 71

Slide 71 text

@supports (display: flex) {…} document.querySelector('E'); …

Slide 72

Slide 72 text

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

Slide 73

Slide 73 text

custom properties :root { var-brand: #F00; } .foo { var-brand: #00F; } … http://dev.w3.org/csswg/css-variables/

Slide 74

Slide 74 text

mixins T.B.D.

Slide 75

Slide 75 text

hierarchy .foo {…} .foo h1 {…} .foo h1 em {…} .foo ul {…} .foo {… & h1 {… & em {…} } & ul {…} }

Slide 76

Slide 76 text

“When can we use them?”

Slide 77

Slide 77 text

1. Browser update cycles are getting more frequent. 2. Old IE is dying fast.

Slide 78

Slide 78 text

IE :'-(

Slide 79

Slide 79 text

No content

Slide 80

Slide 80 text

1. Your environment. 2. How much you want it.

Slide 81

Slide 81 text

tack!

Slide 82

Slide 82 text

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.