Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

Brian Graves @briangraves

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

http://d.fastcompany.net/multisite_files/fastcompany/imagecache/1280/poster/2015/11/3054003-poster-p-1-dont-give-a-hoverboard-this-christmas.jpg

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

https://lh3.googleusercontent.com/-jijITfbqlCk/UUeCfITz0wI/AAAAAAAAQuc/1PjBKq-6KzM/s630-fcrop64=1%2C000033fafffff833/135486852774.jpg

Slide 13

Slide 13 text

The Web

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

Tables

Slide 16

Slide 16 text

Absolute Positioning / Floats / Inline-Block

Slide 17

Slide 17 text

Flexbox / Grids

Slide 18

Slide 18 text

CSS in 2016 is Amazing.

Slide 19

Slide 19 text

WHERE HAVE WE BEEN?

Slide 20

Slide 20 text

There is No CSS3! And other facts about how standards are made.

Slide 21

Slide 21 text

Despite the popularity of the “CSS3” buzzword, there is actually no spec defining such a thing. – Lea Verou

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

Animation

Slide 25

Slide 25 text

Typography

Slide 26

Slide 26 text

Layout

Slide 27

Slide 27 text

“CSS is not a real language”

Slide 28

Slide 28 text

Problems with CSS • Cross-browser compatibility issues • Vendor prefixes • No variables • No inline importing • No nested selectors • No functions • No color manipulation • No basic arithmetic

Slide 29

Slide 29 text

Things That Make Our Lives Easier

Slide 30

Slide 30 text

Rise of the Preprocessors. How we filled in the gaps.

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

.row { @include display-flex; background-color: $color-blue; } .row { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; background-color: #173fb1; }

Slide 35

Slide 35 text

Do Preprocessors Solve The Problem?

Slide 36

Slide 36 text

Preprocessors Perpetuate A Problem. – Aaron Ladage

Slide 37

Slide 37 text

More & More Layers of Abstraction

Slide 38

Slide 38 text

Problems with Preprocessors • Not real front-end code • Proprietary syntax • Often written in non front-end languages • Not as easily extensible • Must be compiled • Compile times can be slow • Browsers are catching up

Slide 39

Slide 39 text

Preprocessors? Where we’re going, we don’t need preprocessors.

Slide 40

Slide 40 text

THE FUTURE OF CSS IS NOW

Slide 41

Slide 41 text

Variables

Slide 42

Slide 42 text

Mixins/Extends

Slide 43

Slide 43 text

Color Functions

Slide 44

Slide 44 text

Nesting

Slide 45

Slide 45 text

Custom Media Queries

Slide 46

Slide 46 text

PostCSS

Slide 47

Slide 47 text

.row { @include display-flex; background: $color-blue; } .row { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; background-color: #173fb1; }

Slide 48

Slide 48 text

.row { display: flex; background: var(--color-blue); } .row { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; background-color: #173fb1; }

Slide 49

Slide 49 text

PostCSS Advantages • Write CSS using CSS • Use CSS3 without worry • Even Use CSS4 • Modular (Use only what you need) • Faster compile times • Built on Node • No Ruby dependencies • Easier to debug • Tons of existing plugins • Can’t find a plugin? Write one in javascript.

Slide 50

Slide 50 text

Autoprefixer

Slide 51

Slide 51 text

PostCSS Ecosystem • Autoprefixer • PostCSS-nested • PostCSS-color-function • PostCSS-calc • PostCSS-custom-properties • PostCSS-apply • PostCSS-custom-media • CSSNext • PostCSS-import • Can’t find a plugin? Write one in javascript.

Slide 52

Slide 52 text

CSS Custom Properties (variables)

Slide 53

Slide 53 text

:root { --color-blue: #0A81C4; --color-blue-dark: #005581; } .element { color: var(--color-blue); } .element:hover { color: var(--color-blue-dark); }

Slide 54

Slide 54 text

Just because you may like Sass variable syntax more does not mean that you should just forsake the new spec. – Jake Albaugh http://codepen.io/jakealbaugh/post/css4-variables-and-sass

Slide 55

Slide 55 text

http://caniuse.com/#feat=css-variables

Slide 56

Slide 56 text

Variables lose their value if you have to constantly track down what they represent. – Ryan Heap

Slide 57

Slide 57 text

No content

Slide 58

Slide 58 text

@Apply (mixins/extends)

Slide 59

Slide 59 text

:root { --clearfix: { display: table; clear: both; content: ‘’; }; } .element:after { @apply --clearfix; }

Slide 60

Slide 60 text

https://www.chromestatus.com/feature/5753701012602880

Slide 61

Slide 61 text

Color Functions

Slide 62

Slide 62 text

.element { color: #1982C5; } .element--modifier { color: color(#1982C5 tint(40%)); }

Slide 63

Slide 63 text

.element { color: #1982C5; } .element--modifier { color: color(#1982C5 shade(40%)); }

Slide 64

Slide 64 text

CSS Color Functions • Tints & Shades • RGBA Adjustment • HSL/HWB Adjustment • Color Blending (blend & blenda) • Guarantee Contrast

Slide 65

Slide 65 text

/* combine with variables to create palettes */ :root { --color-blue: #1982C5; --color-blue-light: color( var(--color-blue) tint(40%) ); --color-blue-dark: color( var(--color-blue) shade(40%) ); }

Slide 66

Slide 66 text

/* map variables to variables */ :root { --color-text: var(--color-blue); --color-text-light: color( var(--color-text) tint(40%) ); --color-text-dark: color( var(--color-text) shade(40%) ); }

Slide 67

Slide 67 text

/* map variables to variables */ :root { --color-text: var(--color-orange); --color-text-light: color( var(--color-text) tint(40%) ); --color-text-dark: color( var(--color-text) shade(40%) ); }

Slide 68

Slide 68 text

Nesting

Slide 69

Slide 69 text

.element { color: blue; {&.modifier { color: red; }} }

Slide 70

Slide 70 text

.element { color: blue; {&.modifier { color: red; }} }

Slide 71

Slide 71 text

.element { color: blue; &.modifier { color: red; } }

Slide 72

Slide 72 text

.im { .a { .way { .over { .nested { .selector { color: red; } } } } } }

Slide 73

Slide 73 text

Custom Media Queries

Slide 74

Slide 74 text

@custom-media --small (min-width: 30em); @media (--small) { .element { font-size: 1.5rem; } }

Slide 75

Slide 75 text

@media only screen and (min-width: 30em) { .element { font-size: 1.5rem; } }

Slide 76

Slide 76 text

@custom-media --small (min-width: 30em); @media (--small) { .element { font-size: 1.5rem; } }

Slide 77

Slide 77 text

New Media Query Syntax

Slide 78

Slide 78 text

@media (width >= 30em) and (width <= 60em) { .element { font-size: 1.5rem; } }

Slide 79

Slide 79 text

@media (min-width: 30em) and (max-width: 60em) { .element { font-size: 1.5rem; } }

Slide 80

Slide 80 text

Partials & Globbing

Slide 81

Slide 81 text

/* generated with grunt-sass-globbing */ @import "utilities/variables"; @import "utilities/mixins"; @import "utilities/reset"; @import “utilities/breakpoints"; @import “atoms/buttons"; @import “atoms/headings"; @import “atoms/icons"; @import “atoms/text"; @import “molecules/components/disclaimer“; …

Slide 82

Slide 82 text

Problems with CSS • Cross-browser compatibility issues • Vendor prefixes • No variables • No inline importing • No nested selectors • No functions/mixins • No color manipulation • No basic arithmetic

Slide 83

Slide 83 text

Problems with CSS • Cross-browser compatibility issues • Vendor prefixes • No variables • No inline importing • No nested selectors • No functions/mixins • No color manipulation • No basic arithmetic

Slide 84

Slide 84 text

Problems with CSS • Cross-browser compatibility issues • Vendor prefixes • No variables • No inline importing • No nested selectors • No functions/mixins • No color manipulation • No basic arithmetic

Slide 85

Slide 85 text

One Day…

Slide 86

Slide 86 text

Let’s Get As Close As We Can To The Real Thing

Slide 87

Slide 87 text

@briangraves Thank You!