Be the browser’s mentor, not its micromanager

A presentation at WDC 2022 in October 2022 in Bristol, UK by Andy Bell

Slide 1

Slide 1

Be the browser’s mentor, not its micromanager WDC 2022 Andy Bell - @hankchizljaw https://set.studio

Slide 2

Slide 2

I’m going to change how you write CSS

Slide 3

Slide 3

Fluid Type Fluid Space Flexible Layouts Progressive Enhancement

Slide 4

Slide 4

We build for everyone Not just for ourselves, or our peer groups

Slide 5

Slide 5

Everyone should get an excellent user experience

Slide 6

Slide 6

No one will ever complain about getting a good baseline experience

Slide 7

Slide 7

Let’s take a look at what we are building buildexcellentwebsit.es

Slide 8

Slide 8

#WebDevConf buildexcellentwebsit.es

Slide 9

Slide 9

Slide 10

Slide 10

The “C” in CSS stands for “Come on, Andy, get on with the good stuff”

Slide 11

Slide 11

Slide 12

Slide 12

CUBE CSS is a CSS methodology that’s orientated towards simplicity, pragmatism and consistency. It’s designed to work with the medium that you’re working in—often the browser—rather than against it.

Slide 13

Slide 13

cube.fyi

Slide 14

Slide 14

Global CSS Composition Utilities Blocks Exceptions

Slide 15

Slide 15

Global CSS Composition Utilities Blocks Exceptions

Slide 16

Slide 16

Global CSS Composition Utilities Blocks Exceptions

Slide 17

Slide 17

Global CSS Composition Utilities Blocks Exceptions

Slide 18

Slide 18

Global CSS Composition Utilities Blocks Exceptions

Slide 19

Slide 19

Home is where the HTML is

Slide 20

Slide 20

It gives tools that help others consume the information on websites a head start.

Slide 21

Slide 21

If the CSS doesn’t load, the website still makes sense!

Slide 22

Slide 22

Old browsers will still get a good baseline experience

Slide 23

Slide 23

Get the HTML right and you’ve built a solid foundation. If not, you’re building on sand.

Slide 24

Slide 24

Stefan Rousseau/AP

Slide 25

Slide 25

Slide 26

Slide 26

https://www.smashingmagazine.com/2020/01/html5-article-section/

Slide 27

Slide 27

Slide 28

Slide 28

Let’s get stuck into some CSS Programming

Slide 29

Slide 29

https://piccalil.li/blog/a-modern-css-reset/

Slide 30

Slide 30

Slide 31

Slide 31

Slide 32

Slide 32

Slide 33

Slide 33

Global CSS Composition Utilities Blocks Exceptions

Slide 34

Slide 34

Slide 35

Slide 35

Slide 36

Slide 36

Slide 37

Slide 37

Slide 38

Slide 38

Fluid type and fluid space

Slide 39

Slide 39

Slide 40

Slide 40

https://www.opensignal.com/sites/opensignal-com/files/data/reports/global/data-2015 08/2015_08_fragmentation_report.pdf

Slide 41

Slide 41

Slide 42

Slide 42

Slide 43

Slide 43

Slide 44

Slide 44

Slide 45

Slide 45

.my-element { font-size: clamp(2rem, calc(1rem + 5vw), 10rem); }

Slide 46

Slide 46

Slide 47

Slide 47

Size and space scales

Slide 48

Slide 48

Slide 49

Slide 49

Step Step Step Step Step 0: 1: 2: 3: 4: 1rem 1.25rem 1.56rem 1.95rem 2.43rem (1 * 1.25) (1.25 * 1.25) (1.56 * 1.25) (1.95 * 1.25)

Slide 50

Slide 50

Slide 51

Slide 51

Slide 52

Slide 52

Slide 53

Slide 53

Slide 54

Slide 54

Slide 55

Slide 55

Slide 56

Slide 56

Slide 57

Slide 57

Slide 58

Slide 58

Back to our CSS

Slide 59

Slide 59

Slide 60

Slide 60

Slide 61

Slide 61

Slide 62

Slide 62

Slide 63

Slide 63

Slide 64

Slide 64

Global CSS Composition Utilities Blocks Exceptions

Slide 65

Slide 65

Slide 66

Slide 66

Hello I am a heading Sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Donec ullamcorper nulla non metus auctor fringilla. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Donec id elit non mi porta gravida at eget metus. A subheading Sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Donec ullamcorper nulla non metus auctor fringilla. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Donec id elit non mi porta gravida at eget metus. 1em

Slide 67

Slide 67

Slide 68

Slide 68

Hello I am a heading Sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Donec ullamcorper nulla non metus auctor fringilla. A subheading Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Donec id elit non mi porta gravida at eget metus. 10rem

Slide 69

Slide 69

Slide 70

Slide 70

Slide 71

Slide 71

Slide 72

Slide 72

Slide 73

Slide 73

Global CSS Composition Utilities Blocks Exceptions

Slide 74

Slide 74

every-layout.dev 40% discount with WDC2022

Slide 75

Slide 75

Slide 76

Slide 76

Slide 77

Slide 77

Slide 78

Slide 78

Slide 79

Slide 79

Slide 80

Slide 80

Slide 81

Slide 81

Slide 82

Slide 82

Slide 83

Slide 83

Slide 84

Slide 84

Global CSS Composition Utilities Blocks Exceptions

Slide 85

Slide 85

Slide 86

Slide 86

Slide 87

Slide 87

Slide 88

Slide 88

Slide 89

Slide 89

Slide 90

Slide 90

Slide 91

Slide 91

Slide 92

Slide 92

Slide 93

Slide 93

Slide 94

Slide 94

Slide 95

Slide 95

Slide 96

Slide 96

Slide 97

Slide 97

Slide 98

Slide 98

Slide 99

Slide 99

Slide 100

Slide 100

Slide 101

Slide 101

Slide 102

Slide 102

Slide 103

Slide 103

Slide 104

Slide 104

Slide 105

Slide 105

Slide 106

Slide 106

https://glitch.com/edit/#!/build-excellent-websites

Slide 107

Slide 107

We’ve never had it better with browsers

Slide 108

Slide 108

Build the whole website with Tailwind

Slide 109

Slide 109

Slide 110

Slide 110

Slide 111

Slide 111

Slide 112

Slide 112

Glitching and flashing

Slide 113

Slide 113

Slide 114

Slide 114

Go forth and build excellent websites

Slide 115

Slide 115

Thank you Andy Bell - @hankchizljaw https://set.studio - @setstudiotweets https://swop.link/set-studio