Slide 1

Slide 1 text

%FTJHOFE 8SJUJOH$44XJUI"DDFTTJCJMJUZJO.JOE *ODMVTJPO GPS Manuel Matuzović @mmatuzo CSS-Minsk-JS 09/2017

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

{ }

Slide 6

Slide 6 text

{ }

Slide 7

Slide 7 text

{ }

Slide 8

Slide 8 text

{ }

Slide 9

Slide 9 text

{ }

Slide 10

Slide 10 text

{ }

Slide 11

Slide 11 text

{ }

Slide 12

Slide 12 text

{ }

Slide 13

Slide 13 text

{ } Name: Manuel Matuzovic

Slide 14

Slide 14 text

{ }

Slide 15

Slide 15 text

{ }

Slide 16

Slide 16 text

{ }

Slide 17

Slide 17 text

{ }

Slide 18

Slide 18 text

{ } ...

Slide 19

Slide 19 text

{ } ...

Slide 20

Slide 20 text

{ } ...

Slide 21

Slide 21 text

{ } ...

Slide 22

Slide 22 text

CSS 2.1

Slide 23

Slide 23 text

CSS 2.1 float position text-align overflow border visibility background-repeat color font-size max-height margin line-height clip display

Slide 24

Slide 24 text

CSS 3

Slide 25

Slide 25 text

CSS 3 border-radius box-shadow text-shadow background-size text-overflow transform transition column animation calc() gradients web fonts

Slide 26

Slide 26 text

CSS

Slide 27

Slide 27 text

CSS Flexbox Grid Custom properties Feature queries Filters Shapes blend-modes Scroll Snap Points sticky :not()

Slide 28

Slide 28 text

With great power comes great responsibility Uncle Ben

Slide 29

Slide 29 text

. } a11y_1 font-size {

Slide 30

Slide 30 text

Zeit Online 20px CSS-Tricks 21px Medium 21px CSS-Minsk-JS 34px/2.5vh Jeffrey Zeldman 24px Hugo Giraudel 20px

Slide 31

Slide 31 text

https://blog.marvelapp.com/body-text-small/

Slide 32

Slide 32 text

. } a11y_2 line-height {

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

. } a11y_3 text-align {

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

. } a11y_4 p: width {

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

DIBSBDUFST QFSMJOF

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

{ } p { max-width: 65ch; }

Slide 46

Slide 46 text

:: } a11y_5 content {

Slide 47

Slide 47 text

{ } h2::after { content: "DON'T DO THAT"; }

Slide 48

Slide 48 text

{ } span::before { content:"\00d7"; }

Slide 49

Slide 49 text

{ } span::before { content:"\00d7"; } →

Slide 50

Slide 50 text

No content

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

{ }

Slide 53

Slide 53 text

. } a11y_6 color & contrast {

Slide 54

Slide 54 text

Colors & Color Contrast

Slide 55

Slide 55 text

Colors & Color Contrast ๏ ~285 million people are visually impaired

Slide 56

Slide 56 text

Colors & Color Contrast ๏ ~285 million people are visually impaired ๏ 39 million are blind and 246 million have low vision

Slide 57

Slide 57 text

Colors & Color Contrast ๏ ~285 million people are visually impaired ๏ 39 million are blind and 246 million have low vision ๏ 7 to 12% of men and less than 1% of women have some form of color-vision deficiency

Slide 58

Slide 58 text

Colors & Color Contrast ๏ ~285 million people are visually impaired ๏ 39 million are blind and 246 million have low vision ๏ 7 to 12% of men and less than 1% of women have some form of color-vision deficiency ๏ People dim their screens

Slide 59

Slide 59 text

Colors & Color Contrast ๏ ~285 million people are visually impaired ๏ 39 million are blind and 246 million have low vision ๏ 7 to 12% of men and less than 1% of women have some form of color-vision deficiency ๏ People dim their screens ๏ People use their smartphones outside even when the sun is shining

Slide 60

Slide 60 text

[…] enough contrast between text and its background so that it can be read by people with moderately low vision […] https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html

Slide 61

Slide 61 text

Contrast ratio

Slide 62

Slide 62 text

Contrast ratio ๏ 1:1 same color for text and background

Slide 63

Slide 63 text

Contrast ratio ๏ 1:1 same color for text and background ๏ 1:21 black text on white background and vice versa

Slide 64

Slide 64 text

Contrast ratio ๏ 1:1 same color for text and background ๏ 1:21 black text on white background and vice versa ๏ Minimum ratio for normal text less than 24px 4.5:1

Slide 65

Slide 65 text

Contrast ratio ๏ 1:1 same color for text and background ๏ 1:21 black text on white background and vice versa ๏ Minimum ratio for normal text less than 24px 4.5:1 ๏ Minimum ratio for bold text less than 19px 3:1

Slide 66

Slide 66 text

Contrast ratio ๏ 1:1 same color for text and background ๏ 1:21 black text on white background and vice versa ๏ Minimum ratio for normal text less than 24px 4.5:1 ๏ Minimum ratio for bold text less than 19px 3:1 ๏ Larger text: 3:1

Slide 67

Slide 67 text

Contrast ratio ๏ 1:1 same color for text and background ๏ 1:21 black text on white background and vice versa ๏ Minimum ratio for normal text less than 24px 4.5:1 ๏ Minimum ratio for bold text less than 19px 3:1 ๏ Larger text: 3:1 ๏ Level AAA: At least 7:1 and 4.5:1

Slide 68

Slide 68 text

No content

Slide 69

Slide 69 text

No content

Slide 70

Slide 70 text

No content

Slide 71

Slide 71 text

No content

Slide 72

Slide 72 text

No content

Slide 73

Slide 73 text

No content

Slide 74

Slide 74 text

No content

Slide 75

Slide 75 text

No content

Slide 76

Slide 76 text

No content

Slide 77

Slide 77 text

Though age has indeed taken its toll on my eyesight, it turns out that I was suffering from a design trend. Kevin Marks

Slide 78

Slide 78 text

@ } media a11y_7 print {

Slide 79

Slide 79 text

{ } @media print { .header { position: static; } nav { display: none; } }

Slide 80

Slide 80 text

{ } @media print { .header { position: static; } nav { display: none; } }

Slide 81

Slide 81 text

{ } body > *:not(main){ display: none; }

Slide 82

Slide 82 text

{ } section { margin-bottom: 2cm; font-size: 14pt; padding: 8mm; }

Slide 83

Slide 83 text

{ } a[href^="http"]:not([href*="mywebsite.com"])::after { content: " (" attr(href) ")"; }

Slide 84

Slide 84 text

{ } a[href^="http"]:not([href*="mywebsite.com"])::after { content: " (" attr(href) ")"; }

Slide 85

Slide 85 text

{ } a[href^="http"]:not([href*="mywebsite.com"])::after { content: " (" attr(href) ")"; }

Slide 86

Slide 86 text

{ } a[href^="http"]:not([href*="mywebsite.com"])::after { content: " (" attr(href) ")"; }

Slide 87

Slide 87 text

{ } a[href^="http"]:not([href*="mywebsite.com"])::after { content: " (" attr(href) ")"; }

Slide 88

Slide 88 text

No content

Slide 89

Slide 89 text

No content

Slide 90

Slide 90 text

: } a11y_8 focus {

Slide 91

Slide 91 text

No content

Slide 92

Slide 92 text

No content

Slide 93

Slide 93 text

{ } Button

Slide 94

Slide 94 text

{ } Button
Button

Slide 95

Slide 95 text

No content

Slide 96

Slide 96 text

No content

Slide 97

Slide 97 text

{ } *:focus { outline: none; }

Slide 98

Slide 98 text

No content

Slide 99

Slide 99 text

No content

Slide 100

Slide 100 text

No content

Slide 101

Slide 101 text

No content

Slide 102

Slide 102 text

{ } input:focus { outline: 2px solid #000000; }

Slide 103

Slide 103 text

No content

Slide 104

Slide 104 text

No content

Slide 105

Slide 105 text

{ } form:focus-within { box-shadow: 0 0 4px 6px #000000; }

Slide 106

Slide 106 text

No content

Slide 107

Slide 107 text

No content

Slide 108

Slide 108 text

{ } :focus { outline: none; } :focus-ring { outline: 2px solid blue; }

Slide 109

Slide 109 text

No content

Slide 110

Slide 110 text

https://www.microsoft.com/en-us/design/inclusive

Slide 111

Slide 111 text

https://www.microsoft.com/en-us/design/inclusive

Slide 112

Slide 112 text

https://www.microsoft.com/en-us/design/inclusive

Slide 113

Slide 113 text

Permanent Temporary Situational https://www.microsoft.com/en-us/design/inclusive

Slide 114

Slide 114 text

. } a11y_9 order {

Slide 115

Slide 115 text

{ }
  • A delicious drink

Slide 116

Slide 116 text

{ }

Slide 117

Slide 117 text

{ } ul {

Slide 118

Slide 118 text

{ } ul { display: grid;

Slide 119

Slide 119 text

{ } ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));

Slide 120

Slide 120 text

{ } ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); grid-gap: 20px;

Slide 121

Slide 121 text

{ } ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); grid-gap: 20px; grid-auto-rows: 180px;

Slide 122

Slide 122 text

{ } ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); grid-gap: 20px; grid-auto-rows: 180px; }

Slide 123

Slide 123 text

No content

Slide 124

Slide 124 text

{ }

Slide 125

Slide 125 text

{ } .long { grid-row: span 2; }

Slide 126

Slide 126 text

{ } .large { grid-row: span 2; } .long { grid-row: span 2; }

Slide 127

Slide 127 text

{ } .large { grid-row: span 2; } .long { grid-row: span 2; } .large1 { grid-column: span 2 / -1; }

Slide 128

Slide 128 text

{ } .large { grid-row: span 2; } .long { grid-row: span 2; } .large1 { grid-column: span 2 / -1; } .large2 { grid-column: 1 / span 2; }

Slide 129

Slide 129 text

No content

Slide 130

Slide 130 text

{ } ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); grid-gap: 20px; grid-auto-rows: 180px; grid-auto-flow: dense; }

Slide 131

Slide 131 text

No content

Slide 132

Slide 132 text

No content

Slide 133

Slide 133 text

Properties that affect order ๏ Flexbox (flex-direction, order,…) ๏ position ๏ float ๏ Negative margins ๏ Grid (order, grid-auto-flow, grid-row, grid-column,…)

Slide 134

Slide 134 text

. } a11y_10 progressive enhancement {

Slide 135

Slide 135 text

No content

Slide 136

Slide 136 text

No content

Slide 137

Slide 137 text

No content

Slide 138

Slide 138 text

You Don’t Have To Overwrite Everything ๏ display: inline-block ๏ display: table-cell ๏ vertical-align ๏ column-* properties ๏ float …have no effect on grid- or flex-items

Slide 139

Slide 139 text

. } a11y_11 flat structures {

Slide 140

Slide 140 text

No content

Slide 141

Slide 141 text

{ }

Heading

  • Element 1
  • Element 2
  • Element 3
  • Element 4
  • Element 5
  • Element 6

Slide 142

Slide 142 text

{ } .wrapper { display: grid; grid-template-columns: 120px repeat(2, 1fr); grid-gap: 20px; } h2 { grid-column: 2 / -1; }

Slide 143

Slide 143 text

No content

Slide 144

Slide 144 text

{ }

Heading

Element 1
Element 2
Element 3
Element 4
Element 5
Element 6

Slide 145

Slide 145 text

{ } ul { display: subgrid; }

Slide 146

Slide 146 text

{ } ul { display: contents; }

Slide 147

Slide 147 text

No content

Slide 148

Slide 148 text

{ } ul { display: grid; grid-template-columns: 120px repeat(2, 1fr); grid-gap: 20px; }

Slide 149

Slide 149 text

{ } ul { grid-column: 1 / -1; display: inherit; grid-template-columns: inherit; grid-gap: inherit; display: contents; }

Slide 150

Slide 150 text

{ }

Heading

Element 1
Element 2
Element 3
Element 4
Element 5
Element 6

Slide 151

Slide 151 text

{ }

Slide 152

Slide 152 text

Designing with constraints in mind is simply designing well. Aaron Gustafson

Slide 153

Slide 153 text

5IBOLZPV Manuel Matuzović @mmatuzo CSS-Minsk-JS 09/2017