Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

Me Our CSS Conflicting media queries !important styles Styles that seem to do nothing but we’re too scared to remove

Slide 5

Slide 5 text

HTML Look at me! " " UTILITY-FIRST CSS

Slide 6

Slide 6 text

HTML Look at me! " " COMPONENT-FIRST CSS

Slide 7

Slide 7 text

You, maybe

Slide 8

Slide 8 text

In Defense of Utility-First CSS DOTC SS 2019 SARAH DAYAN | SO FTWA RE ENGINEER @ A LGOL IA

Slide 9

Slide 9 text

01010101 01110100 01101001 01101100 01101001 01110100 01111001 00100000 01100110 01101001 01110010 01110011 01110100 00100000 01000011 01010011 01010011 00100000 01101001 01110011 00100000 01100110 01110010 01100101 01100001 01101011 01101001 01101110 01100111 00100000 01100001 01110111 01100101 01110011 01101111 01101101 01100101 00101110 The myth of separation of concerns

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

CSS Zen Garden is a technical demonstration, not a best practice.

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

Strict separation of concerns between HTML and CSS is impractical.

Slide 14

Slide 14 text

HTML CSS CSS HTML

Slide 15

Slide 15 text

When you think about the relationship between HTML and CSS in terms of "separation of concerns", it's very black and white. Instead, think about dependency direction. Adam Wathan, creator of Tailwind CSS

Slide 16

Slide 16 text

HTML

Testimonials"

Read what our awesome customers have to say."

Stephen King"

This utility-first thingy looks legit AF."

"

Lady Gaga"

I recommended this to all my little monsters."

"
"
"

Slide 17

Slide 17 text

CSS .testimonials { color: #c5c9e0; } .testimonials h2 { font-size: 18px; color: #3a416f; } .testimonials h3 { font-size: 14px; } .testimonial-inner { display: flex; } .testimonial h4 { font-size: 12px; color: #3a416f; } .testimonial img { width: 40px; height: 40px; }

Slide 18

Slide 18 text

HTML - + +

Testimonials"

Read what our awesome customers have to say."

Stephen King"

This utility-first thingy looks legit AF."

"

Lady Gaga"

I recommended this to all my little monsters."

"
"
"

Slide 19

Slide 19 text

CSS - .testimonials { color: #c5c9e0; } .testimonials h2 { font-size: 18px; color: #3a416f; } .testimonials h3 { font-size: 14px; } .testimonial-inner { display: flex; } .testimonial h4 { font-size: 12px; color: #3a416f; } .testimonial img { width: 40px; height: 40px; }

Slide 20

Slide 20 text

CSS - + .testimonials { color: #c5c9e0; } .testimonials h2 { font-size: 18px; color: #3a416f; } .testimonials h3 { font-size: 14px; } .testimonial-inner { display: flex; } .testimonial h4 { font-size: 12px; color: #3a416f; } .testimonial img { width: 40px; height: 40px; }

Slide 21

Slide 21 text

HTML

Testimonials"

Read what our awesome customers have to say."

Stephen King"

This utility-first thingy looks legit AF."

"

Lady Gaga"

I recommended this to all my little monsters."

"
"
"

Slide 22

Slide 22 text

CSS works better when used as a library.

Slide 23

Slide 23 text

OOCSS by Nicole Sullivan

Slide 24

Slide 24 text

HTML

Testimonials"

Read what our awesome customers have to say."

Stephen King"

This utility-first thingy looks legit AF."

"

Lady Gaga"

I recommended this to all my little monsters."

"
"
"

Slide 25

Slide 25 text

Why not stop at component-based CSS?

Slide 26

Slide 26 text

01010101 01110100 01101001 01101100 01101001 01110100 01111001 00100000 01100110 01101001 01110010 01110011 01110100 00100000 01000011 01010011 01010011 00100000 01101001 01110011 00100000 01100110 01110010 01100101 01100001 01101011 01101001 01101110 01100111 00100000 01100001 01110111 01100101 01110011 01101111 01101101 01100101 00101110 Rethinking Reusability

Slide 27

Slide 27 text

HTML

The Shining"

…"

"

Stephen King"

American author"

"
"
"

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

HTML

The Shining"

…"

"

Stephen King"

American author"

"
"
"

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

Complex UI components aren’t that reusable.

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

In UI design, the atom isn’t the component.

Slide 38

Slide 38 text

Atomic Design Methodology, by Brad Frost bit.ly/2qRoByI

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

Reusing small atoms is more resilient.

Slide 41

Slide 41 text

01010101 01110100 01101001 01101100 01101001 01110100 01111001 00100000 01100110 01101001 01110010 01110011 01110100 00100000 01000011 01010011 01010011 00100000 01101001 01110011 00100000 01100110 01110010 01100101 01100001 01101011 01101001 01101110 01100111 00100000 01100001 01110111 01100101 01110011 01101111 01101101 01100101 00101110 CSS as a Design System

Slide 42

Slide 42 text

JSX const Testimonial = ({ author, img, children }) "=> (
{img "&& {author}}

{author}"

{children}"

"
"
);

Slide 43

Slide 43 text

JSX const App = () "=> (

Testimonials"

""..."

This utility-first thingy looks legit AF. " I recommended this to all my little monsters. " "
);

Slide 44

Slide 44 text

But it’s like inline styles!

Slide 45

Slide 45 text

Slide 46

Slide 46 text

But the HTML will get so heavy!

Slide 47

Slide 47 text

HTML
" "
"
"
" "

Slide 48

Slide 48 text

Slide 49

Slide 49 text

513.09 KB UTILITY-FIRST 441.67 KB SEMANTIC 34.87 KB 33.69 KB Uncompressed Gzip Brotli 50.36 KB 47.66 KB

Slide 50

Slide 50 text

0KB 32,5KB 65KB 97,5KB 130KB CSS size on algolia.com/doc (uncompressed) 50 KB 125 KB Before utility-first After utility-first

Slide 51

Slide 51 text

But it’s ugly!

Slide 52

Slide 52 text

HTML Look at me! " "

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

Can we still use components?

Slide 55

Slide 55 text

Click me Click me too ?

Slide 56

Slide 56 text

Keep your options open.

Slide 57

Slide 57 text

Embrace change, within reason.

Slide 58

Slide 58 text

Thank you! bit.ly/2pO9aGX @frontstuff_io