Believe in the Power of CSS

A presentation at Connect.Tech in October 2019 in Atlanta, GA, USA by Christopher A DeMars

Slide 1

Slide 1

Not in this talk Chris DeMars ! @saltnburnem 1 #ConnectTech #DeveloperCommunity

Slide 2

Slide 2

Not in this talk 🚫 Styled components Chris DeMars ! @saltnburnem 1 #ConnectTech #DeveloperCommunity

Slide 3

Slide 3

Not in this talk 🚫 Styled components 🚫 Css-in-js Chris DeMars ! @saltnburnem 1 #ConnectTech #DeveloperCommunity

Slide 4

Slide 4

Twitter: saltnburnem | Site: chrisdemars.com

Slide 5

Slide 5

Disclaimer Chris DeMars ! @saltnburnem

3 #ConnectTech #DeveloperCommunity Why do I love CSS? I started building web pages 22 years ago, 8 of those professionally! I am what you call an OG. When I started we had HTML, that was it, eventually CSS and JS came on the scene but not at the level it is at now. There are tons of wonderful things we can do with CSS today, yet, CSS devs, UI devs who work solely on the structure and presentation are looked at as second class devs. But I am here to tell you that what you do and the code you write makes a huge impact, so keep doing you! (NEXT SLIDE)

Slide 6

Slide 6

Disclaimer 🎉 I 💚 CSS 🎉 Chris DeMars ! @saltnburnem 3 #ConnectTech #DeveloperCommunity

Slide 7

Slide 7

Chris DeMars ! @saltnburnem

4 #ConnectTech #DeveloperCommunity Who has seen this before? This bothers me. We didn’t just evolve into styled components being the superior way to write css. When did this happen? How did this happen? (NEXT SLIDE)

Slide 8

Slide 8

CSS Chris DeMars ! @saltnburnem 4 #ConnectTech #DeveloperCommunity

Slide 9

Slide 9

CSS Chris DeMars ! @saltnburnem CSS 4 #ConnectTech #DeveloperCommunity

Slide 10

Slide 10

CSS Chris DeMars ! @saltnburnem CSS CSS 4 #ConnectTech #DeveloperCommunity

Slide 11

Slide 11

CSS Chris DeMars ! @saltnburnem CSS CSS 4 CSS #ConnectTech #DeveloperCommunity

Slide 12

Slide 12

CSS Chris DeMars ! @saltnburnem CSS CSS 4 CSS CSS #ConnectTech #DeveloperCommunity

Slide 13

Slide 13

“CSS is a key development skill.” - Ivana McConnell @ CSSConf AU Chris DeMars ! @saltnburnem 5 #ConnectTech #DeveloperCommunity

Slide 14

Slide 14

“…also the problems with how we devalue things like CSS…”

  • Ivana Michael @ CSSConf AU Chris DeMars ! @saltnburnem 6 #ConnectTech #DeveloperCommunity

Slide 15

Slide 15

CSS IS STILL A THING! Chris DeMars ! @saltnburnem 7

  • CSS is still a thing and I hope by the end of this talk you will love it as much as I do. (CLICK) #ConnectTech #DeveloperCommunity

Slide 16

Slide 16

Una kravets The power of css Front-trends 2017 https://youtu.be/IRI1H5tyEAo Chris DeMars ! @saltnburnem 8 #ConnectTech #DeveloperCommunity

Slide 17

Slide 17

Chris DeMars ! @saltnburnem

9 #ConnectTech #DeveloperCommunity I feel very strong on knowing your history and your roots and where things started before you can actually understand the why behind what you are doing. I get the question a lot as to why you love history on the web, well, in opinion I feel it is necessary for you to know who paved the way for us in this industry, it is only right to know about talk about that history.

Slide 18

Slide 18

Chris DeMars ! @saltnburnem

10 #ConnectTech #DeveloperCommunity Who remembers writing code like this? These were the good ole days right? JavaScript wasn’t a huge thing yet. CSS was making its way there. Of course I didn’t have a fancy editor at the time so this code would have been written in notepad on a Windows 95 machine….oh yeah I went there. Not even indentation! How did I ever get by writing code like this as a young kid?

Slide 19

Slide 19

Chris DeMars ! @saltnburnem

Let us on a journey back to 1994. How did we get here? 11 #ConnectTech #DeveloperCommunity

Slide 20

Slide 20

e i L m u i W n o Hak Chris DeMars ! @saltnburnem

s o B t r Be 12 #ConnectTech #DeveloperCommunity For two years Hakon and Bert worked together to create a style language to style this thing called hypertext markup language, I don’t know if you have ever heard of it but it is pretty cool, it was created by Sir Tim Berners-Lee. Hakon Lie, the godfather of CSS, and Bert Bos made that possible. (CLICK) No Bert Bos is not Wes Bos’s dad.

Slide 21

Slide 21

s o B Wes Chris DeMars ! @saltnburnem

No Bert Bos is not Wes Bos’s dad. s o B t r Be 13 #ConnectTech #DeveloperCommunity

Slide 22

Slide 22

s o B Wes Chris DeMars ! @saltnburnem s o B t r Be 13 #ConnectTech #DeveloperCommunity

Slide 23

Slide 23

Chris DeMars ! @saltnburnem

December of 1996, CSS1 became an official recommendation. The state of the web as we knew it, would forever change. The way we design experiences, would change in ways unimaginable. (CLICK) 14 #ConnectTech #DeveloperCommunity

Slide 24

Slide 24

Chris DeMars ! @saltnburnem

15 #ConnectTech #DeveloperCommunity We have so many new things and the level of CSS awesomeness out there is literally mind blowing. It is an exciting time for developers…as long as we don’t think about IE11. But there are ways around IE11 so that is okay.

Slide 25

Slide 25

Chris DeMars ! @saltnburnem 16 #ConnectTech #DeveloperCommunity So with the advances of CSS, these are a few things we are going to talk about today, and show some demos, maybe get in to some real demos. We are just going to have some fun, sound good?

Slide 26

Slide 26

Flexbox Chris DeMars ! @saltnburnem 16 #ConnectTech #DeveloperCommunity

Slide 27

Slide 27

Flexbox Grid Chris DeMars ! @saltnburnem 16 #ConnectTech #DeveloperCommunity

Slide 28

Slide 28

Flexbox Grid CSS variables Chris DeMars ! @saltnburnem 16 #ConnectTech #DeveloperCommunity

Slide 29

Slide 29

Flexbox Grid CSS variables Blend modes Chris DeMars ! @saltnburnem 16 #ConnectTech #DeveloperCommunity

Slide 30

Slide 30

Flexbox Grid CSS variables Blend modes Viewport units Chris DeMars ! @saltnburnem 16 #ConnectTech #DeveloperCommunity

Slide 31

Slide 31

Flexbox Grid CSS variables Blend modes Viewport units Accessibility Chris DeMars ! @saltnburnem 16 #ConnectTech #DeveloperCommunity

Slide 32

Slide 32

Flexbox Grid CSS variables Blend modes Viewport units Accessibility And more… Chris DeMars ! @saltnburnem 16 #ConnectTech #DeveloperCommunity

Slide 33

Slide 33

Chris DeMars ! @saltnburnem

Let’s talk a little bit about architecture. 17 #ConnectTech #DeveloperCommunity

Slide 34

Slide 34

Oocss Chris DeMars ! @saltnburnem 18 #ConnectTech #DeveloperCommunity (CLICK) BEM is block, element, modifier. (CLICK) SMACSS has an architecture where you break out your styles in to base, layout, modules, and state. INUIT is just an architecture framework for CSS Atomic is based off of atoms, molecules, organisms etc to craft reusable components. OOCSS is object oriented css created by Nicole Sullivan. It has two main principles. Separation of content and container, and separation of structure and skin.

Slide 35

Slide 35

Oocss Chris DeMars ! @saltnburnem 18 #ConnectTech #DeveloperCommunity

Slide 36

Slide 36

Double-Double Block__Element—Modifier Single-Single Block_Element-Modifier Chris DeMars ! @saltnburnem 19 #ConnectTech #DeveloperCommunity (CLICK) BEM is block, element, modifier. SMACSS has an architecture where you break out your styles in to base, layout, modules, and state. INUIT is just an architecture framework for CSS Atomic is based off of atoms, molecules, organisms etc to craft reusable components. OOCSS is object oriented css created by Nicole Sullivan. It has two main principles. Separation of content and container, and separation of structure and skin.

Slide 37

Slide 37

Oocss Chris DeMars ! @saltnburnem 20 #ConnectTech #DeveloperCommunity (CLICK) BEM is block, element, modifier. (CLICK) SMACSS has an architecture where you break out your styles in to base, layout, modules, and state. INUIT is just an architecture framework for CSS Atomic is based off of atoms, molecules, organisms etc to craft reusable components. OOCSS is object oriented css created by Nicole Sullivan. It has two main principles. Separation of content and container, and separation of structure and skin.

Slide 38

Slide 38

Oocss Chris DeMars ! @saltnburnem 20 #ConnectTech #DeveloperCommunity

Slide 39

Slide 39

Oocss Chris DeMars ! @saltnburnem 20 #ConnectTech #DeveloperCommunity

Slide 40

Slide 40

Oocss Chris DeMars ! @saltnburnem 20 #ConnectTech #DeveloperCommunity

Slide 41

Slide 41

Oocss Chris DeMars ! @saltnburnem 20 #ConnectTech #DeveloperCommunity

Slide 42

Slide 42

Makes writing css fun! Chris DeMars ! @saltnburnem 21 It also makes writing code (CLICK) maintainable, (CLICK), modular, (CLICK) and flexible. #ConnectTech #DeveloperCommunity

Slide 43

Slide 43

Makes writing css fun! Maintainable Chris DeMars ! @saltnburnem 21 #ConnectTech #DeveloperCommunity

Slide 44

Slide 44

Makes writing css fun! Maintainable Chris DeMars ! @saltnburnem Modular 21 #ConnectTech #DeveloperCommunity

Slide 45

Slide 45

Makes writing css fun! Maintainable Chris DeMars ! @saltnburnem Modular 21 Flexible #ConnectTech #DeveloperCommunity

Slide 46

Slide 46

https://bit.ly/2GRhU2T Chris DeMars ! @saltnburnem 22

  • If you want to check out my slides about BEM and CSS architectures you can go here. #ConnectTech #DeveloperCommunity

Slide 47

Slide 47

Chris DeMars ! @saltnburnem 23 #ConnectTech #DeveloperCommunity

Slide 48

Slide 48

Chris DeMars ! @saltnburnem 24 #ConnectTech #DeveloperCommunity I am going to be showing a lot of screen shots from caniuse so you can see the browser support for each of the things I am talking about.

Slide 49

Slide 49

One dimension Chris DeMars ! @saltnburnem 25 Flexbox is great because it is one dimension. What I mean by one dimension is this. (CLICK) #ConnectTech #DeveloperCommunity

Slide 50

Slide 50

https://css-tricks.com/snippets/css/a-guide-to-flexbox/ Chris DeMars ! @saltnburnem 26 #ConnectTech #DeveloperCommunity With flex box we have two axis, we have the x axis and the y axis. Flexbox works along these axese, BUT it only works on one axis at a time. You have a main axis which is is horizontal, and a cross axis which is vertical. The axis are determined by the direction you are flexing your parent container, called the flex direction. This is a property that you add to the flex parent, which is usually the container that is going to house the flex children. When the flex direction changes, so do the axis.

Slide 51

Slide 51

#1 problem Chris DeMars ! @saltnburnem What is the number problem we have as front end devs, even back ends? 27 #ConnectTech #DeveloperCommunity

Slide 52

Slide 52

Centering Chris DeMars ! @saltnburnem 28 #ConnectTech #DeveloperCommunity CENTERING!! Centering something horizontally and vertically has always been a problem in CSS. Spacing stuff with margin or margin: 0 auto. Using transforms to position things with negative and positive numbers. No longer do we have to do that with flex box. Would you believe me if I told you that it only takes THREE properties on your flex parent so center something horizontally and vertically? Check it out. (CLICK)

Slide 53

Slide 53

Chris DeMars ! @saltnburnem

29 #ConnectTech #DeveloperCommunity What am I doing in this demo is I am taking the flex parent which I called main-title and adding a display of flex to it, than I am adding a flex direction of column for sanity, than I am setting justify content and align items to center, and bam. Centered in the parent horizontally and vertically. Amazing right?

Slide 54

Slide 54

Chris DeMars ! @saltnburnem 29 #ConnectTech #DeveloperCommunity

Slide 55

Slide 55

Chris DeMars ! @saltnburnem 30 #ConnectTech #DeveloperCommunity

Slide 56

Slide 56

Chris DeMars ! @saltnburnem 31 #ConnectTech #DeveloperCommunity

Slide 57

Slide 57

Chris DeMars ! @saltnburnem 32 #ConnectTech #DeveloperCommunity

Slide 58

Slide 58

Chris DeMars ! @saltnburnem 33 #ConnectTech #DeveloperCommunity

Slide 59

Slide 59

Mozilla developer network https://bit.ly/2nXMfIg Chris DeMars ! @saltnburnem https://www.youtube.com/channel/UCh5UlGiu9d6LegIeUCW4N1w https://bit.ly/2nXMfIg 34 #ConnectTech #DeveloperCommunity

Slide 60

Slide 60

Two dimensions Chris DeMars ! @saltnburnem

What do I mean by two dimensions? It works on both axis 35 #ConnectTech #DeveloperCommunity

Slide 61

Slide 61

Rows & columns Chris DeMars ! @saltnburnem

Grid works in a system of rows and columns, at the same time. Since it works this way, you can start creating layouts we only dreamed about. 36 #ConnectTech #DeveloperCommunity

Slide 62

Slide 62

Chris DeMars ! @saltnburnem

37 Magazine style layouts, this is great! This is Miriam Suzanne’s site, she is a developer from Denver. Also an advocate for CSS, design systems, and Sass. She co-wrote a book with Hugo Giraduel about Sass and created the Sass responsive framework Susy.

Slide 63

Slide 63

Chris DeMars ! @saltnburnem 37

Slide 64

Slide 64

Chris DeMars ! @saltnburnem

This is Andy Clarke’s site. All written in CSS, no JS. Amazing. 38

Slide 65

Slide 65

Chris DeMars ! @saltnburnem 38

Slide 66

Slide 66

Chris DeMars ! @saltnburnem

39 This is the Mondrian grid created by Piet Mondrian. He was a famous artist who expressed his vocabulary in the three primary colors, red, blue, yellow. The three primary values, black, white, and gray, and the primary directions, horizontal and vertical. What Jen Simmons did was take a picture of the Mondrian grid, cut it up in Photoshop, save out the images, and than put them back together using grid, AND made it responsive.

Slide 67

Slide 67

Chris DeMars ! @saltnburnem 39

Slide 68

Slide 68

Chris DeMars ! @saltnburnem

40 This is another example of a magazine/flyer style layout using Grid that Jen Simmons did as an experiment. In this example I am using Firefox Dev edition to show off a little of what the features in their dev tools can do. I will get more in to this in a couple slides.

Slide 69

Slide 69

Chris DeMars ! @saltnburnem 40

Slide 70

Slide 70

Chris DeMars ! @saltnburnem

In this example I am setting the div with a class of grid, to display grid. Than I am setting the grid template columns to 150px auto 150px. I set the grid template rows to auto 1fr auto. Set a grid gap to 1em, you can set it to whatever spacing you like. Than I set the height to 100vh so it takes up 100% of the viewport height. The header grid-row: 1 grid-column: 1 / 4 The sidebar-a grid-row: 2 grid-column: 1 / 2 The main grid-row: 2 grid-column: 2 / 3 The sidebar-b grid-row: 2 41 #ConnectTech #DeveloperCommunity

Slide 71

Slide 71

grid-column: 3 / 4 The footer grid-row: 3 grid-column: 1 / 4

Slide 72

Slide 72

Chris DeMars ! @saltnburnem 41 #ConnectTech #DeveloperCommunity

Slide 73

Slide 73

s n o m eJ n Sim Chris DeMars ! @saltnburnem w e r d n A Rachel 42 #ConnectTech #DeveloperCommunity

  • Two very important ppl to be following in the industry right now. Jen Simmons and Rachel Andrew have put in tons of work getting the grid in to the spec and browser support around it. They both speak about grid, have written books, and Jen has a series on YouTube called Layout Land where she talks all about newer CSS things. So you should definitely check that out.

Slide 74

Slide 74

Chris DeMars ! @saltnburnem 43 #ConnectTech #DeveloperCommunity

  • Ohhhh Firefox. Just when I thought I couldn’t use you, you come out guns blazing with (CLICK) Quantum. Check this out. (CLICK)

Slide 75

Slide 75

Chris DeMars ! @saltnburnem 44 #ConnectTech #DeveloperCommunity

  • Ohhhh Firefox. Just when I thought I couldn’t use you, you come out guns blazing with (CLICK) Quantum. The newest version of Firefox is really fast and is the only browser at the moment that has grid features built in to their dev tools. Check this out. (CLICK)

Slide 76

Slide 76

Chris DeMars ! @saltnburnem 45 #ConnectTech #DeveloperCommunity

  • In the dev tools you can check to see if a grid is being used. You can change colors of the grid lines. You can display area names which are names you can give to the actual areas of the content, like header, sidebar, footer. You can also see the implicit and explicit grids as well. Great stuff from Firefox. I only can see it getting better.

Slide 77

Slide 77

Chris DeMars ! @saltnburnem 45 #ConnectTech #DeveloperCommunity

Slide 78

Slide 78

Chris DeMars ! @saltnburnem 46 #ConnectTech #DeveloperCommunity

Slide 79

Slide 79

Chris DeMars ! @saltnburnem 47 #ConnectTech #DeveloperCommunity

Slide 80

Slide 80

Chris DeMars ! @saltnburnem (CLICK) 48 #ConnectTech #DeveloperCommunity

Slide 81

Slide 81

Chris DeMars ! @saltnburnem 48 #ConnectTech #DeveloperCommunity

Slide 82

Slide 82

Chris DeMars ! @saltnburnem

49 #ConnectTech #DeveloperCommunity I am setting a height of 100vh on the main-title class so it takes up 100% of the viewport. And also a width to take up 100% of the width. I am also setting a height of 50vh to take up half the screen or 50% of the screen, and than the width to be 100% using 100vw.

Slide 83

Slide 83

Chris DeMars ! @saltnburnem 49 #ConnectTech #DeveloperCommunity

Slide 84

Slide 84

Chris DeMars ! @saltnburnem 50 #ConnectTech #DeveloperCommunity

Slide 85

Slide 85

Chris DeMars ! @saltnburnem 51 #ConnectTech #DeveloperCommunity

Slide 86

Slide 86

🤬 Chris DeMars ! @saltnburnem 51 #ConnectTech #DeveloperCommunity

Slide 87

Slide 87

Sass & less Variables Chris DeMars ! @saltnburnem 52 #ConnectTech #DeveloperCommunity

  • Sass and Less variables are great. The introduction of having variables in anything CSS related is great, but we do have some drawbacks when it comes to variables and preprocessors. (CLICK)

Slide 88

Slide 88

Drawbacks Dom unaware Can’t change dynamically No js targets Chris DeMars ! @saltnburnem

53 #ConnectTech #DeveloperCommunity DOM aware meaning that the DOM has no clue about what a Sass or Less variable is. The DOM does not process this information. All of the variables are compiled before run time. Since the DOM doesn’t recognize variables, that means they aren’t reactive either, therefore you can’t change them dynamically. You also can’t target any Sass or Less variables with JS. (CLICK)

Slide 89

Slide 89

Pros of css vars Inheritance Cascade js targets Chris DeMars ! @saltnburnem

  • Pros to CSS variables. (CLICK) 54 #ConnectTech #DeveloperCommunity

Slide 90

Slide 90

Use cases For Custom props Chris DeMars ! @saltnburnem (CLICK) 55 #ConnectTech #DeveloperCommunity

Slide 91

Slide 91

Emulate Non-existent Rules https://bit.ly/2opAqp4 Chris DeMars ! @saltnburnem 56 #ConnectTech #DeveloperCommunity

  • Setting a hover color for the box shadow. This code is setting the shadow of the box to yellow by default, but than changing it to orange on hover. (CLICK)

Slide 92

Slide 92

Themes Chris DeMars ! @saltnburnem

  • Setting themes for your experiences. 57 https://bit.ly/2opAqp4 #ConnectTech #DeveloperCommunity

Slide 93

Slide 93

Support? https://bit.ly/2opAqp4 Chris DeMars ! @saltnburnem 58 #ConnectTech #DeveloperCommunity

  • You can check for support using a @supports feature query. To provide fallback support you also have to check to see the support with JS. (CLICK)

Slide 94

Slide 94

Css variables Syntax Chris DeMars ! @saltnburnem (CLICK) 59 #ConnectTech #DeveloperCommunity

Slide 95

Slide 95

Chris DeMars ! @saltnburnem

60 You can declare variables at the root level using colon root. Than the proper syntax is the double dash and than a semantically correct variable that makes sense for the experience. In the code, you declare the variable using the var keyword, than parens with the variable name inside it. You can also do style declaration scoping which is so cool. (CLICK)

Slide 96

Slide 96

Chris DeMars ! @saltnburnem

61 #ConnectTech #DeveloperCommunity You can see that I am declaring the variables at the root level and than just using them with the var keyword for all the classes to set the background colors of the different sections. Than I go back and change the background color on the header class. Using style scoping or variable scoping. (CLICK)

Slide 97

Slide 97

Chris DeMars ! @saltnburnem 61 #ConnectTech #DeveloperCommunity

Slide 98

Slide 98

Chris DeMars ! @saltnburnem 62 #ConnectTech #DeveloperCommunity

Slide 99

Slide 99

Chris DeMars ! @saltnburnem

  • WHYYYYYYYYYY???????????? (CLICK) 63 #ConnectTech #DeveloperCommunity

Slide 100

Slide 100

🤬🤬 Chris DeMars ! @saltnburnem 63 #ConnectTech #DeveloperCommunity

Slide 101

Slide 101

Image effects in the browser Chris DeMars ! @saltnburnem 64

  • If we can now do image effects in the browser, like Instagram filters, what does this mean? (CLICK) #ConnectTech #DeveloperCommunity

Slide 102

Slide 102

Chris DeMars ! @saltnburnem

  • No more Photoshop! 65 #ConnectTech #DeveloperCommunity

Slide 103

Slide 103

Chris DeMars ! @saltnburnem 🚫 65 #ConnectTech #DeveloperCommunity

Slide 104

Slide 104

Types Chris DeMars ! @saltnburnem

66 #ConnectTech #DeveloperCommunity Two types of blend modes. We have background blend modes and mixed blend modes. The example I am going to run through on CodePen are all using the background blend modes, all 15 of them, but I discuss what 6 of those 15 are. (CLICK)

Slide 105

Slide 105

Types Background blend mode Chris DeMars ! @saltnburnem 66 #ConnectTech #DeveloperCommunity

Slide 106

Slide 106

Types Background Mixed blend mode blend mode Chris DeMars ! @saltnburnem 66 #ConnectTech #DeveloperCommunity

Slide 107

Slide 107

Mixed blend mode Chris DeMars ! @saltnburnem

Initial: Default setting of the property that does not set a blend mode. Inherit: inherits the blend mode from its parent. Unset: Removes the blend mode from an element. 67 #ConnectTech #DeveloperCommunity

Slide 108

Slide 108

Mixed blend mode initial: Default setting of the property that does not set a blend mode. Chris DeMars ! @saltnburnem 67 #ConnectTech #DeveloperCommunity

Slide 109

Slide 109

Mixed blend mode initial: Default setting of the property that does not set a blend mode. inherit: inherits the blend mode from its parent. Chris DeMars ! @saltnburnem 67 #ConnectTech #DeveloperCommunity

Slide 110

Slide 110

Mixed blend mode initial: Default setting of the property that does not set a blend mode. inherit: inherits the blend mode from its parent. Unset: Removes the blend mode from an element. Chris DeMars ! @saltnburnem 67 #ConnectTech #DeveloperCommunity

Slide 111

Slide 111

Chris DeMars ! @saltnburnem 68 #ConnectTech #DeveloperCommunity multiply: the background-image and background-color are multiplied and typically this leads to a darker image than before. screen: both image and color is inverted, multiplied and then inverted again. overlay: the background-color is mixed with the background-image to reflect the lightness or darkness of the backdrop. darken: if the background-image is darker than the background-color then the image is replaced, otherwise it is left as it was. lighten: if the background-image is lighter than the background-color then the image is replaced, otherwise it is left as it was. color-dodge: the background-color is divided by the inverse of the background-image. This is very similar to the screen blend mode.

Slide 112

Slide 112

Chris DeMars ! @saltnburnem 68 #ConnectTech #DeveloperCommunity

Slide 113

Slide 113

Chris DeMars ! @saltnburnem

69 #ConnectTech #DeveloperCommunity One of my favorite topics and one I speak about everywhere. Show of hands, where are my front end devs? Back end devs? Designers? Who works on accessibility?

Slide 114

Slide 114

Numeronym Chris DeMars ! @saltnburnem

  • The word accessibility is a numeronym. 70 #ConnectTech #DeveloperCommunity

Slide 115

Slide 115

Numeronym A c c e s s i b i l i t y A 1 2 3 4 5 6 7 8 9 10 11 y A11y Chris DeMars ! @saltnburnem 70 #ConnectTech #DeveloperCommunity

Slide 116

Slide 116

:focus Chris DeMars ! @saltnburnem

71 #ConnectTech #DeveloperCommunity What is focus? Well first it is a pseudo class, often written like this. The visual cue that focus has been given to an element on a page.

Slide 117

Slide 117

Don’t do this! Chris DeMars ! @saltnburnem

72 #ConnectTech #DeveloperCommunity If you see something like this, please fix it. This is not good. What this is doing is it is removing the focus outline around elements for both keyboard and mouse users, that is no bueno. In CSS we have things like resets. There are two main ones that we use. Eric Meyers Reset and Normalize. In Eric’s reset, he sets the :focus to 0, BUT he explicitly says to add it back in however you so choose, in your own stylesheet. (CLICK)

Slide 118

Slide 118

Don’t do this! Chris DeMars ! @saltnburnem 72 #ConnectTech #DeveloperCommunity

Slide 119

Slide 119

Chris DeMars ! @saltnburnem

(CLICK) 73 #ConnectTech #DeveloperCommunity

Slide 120

Slide 120

Chris DeMars ! @saltnburnem 73 #ConnectTech #DeveloperCommunity

Slide 121

Slide 121

:focus-visible Chris DeMars ! @saltnburnem 74 #ConnectTech #DeveloperCommunity

  • Focus visible used to be focus ring but was changed at the end of last year. This is a great pseudo class that doesn’t have full support yet. (CLICK)

Slide 122

Slide 122

Yayyyyy!!

  • It is in the css4 working draft now, so we have to work to get this in to all the browsers. Currently there is a polyfill you can use to accomplish focus-visible, also it sort of works in Firefox with the -moz prefix. (CLICK)

Slide 123

Slide 123

Focus-visible polyfill https://github.com/WICG/focus-visible Chris DeMars ! @saltnburnem 76 #ConnectTech #DeveloperCommunity

  • Here is a link to the polyfill. Created by the great engineers at Google, two of them being Rob Dodson and Alice Boxhall, if you do not follow them I suggest you do. Rob has a series of accessibility videos on the Google Developers YouTube channel called Ally Casts, a lot of good information there. (CLICK)

Slide 124

Slide 124

Chris DeMars ! @saltnburnem 77 #ConnectTech #DeveloperCommunity

  • This line of code takes the focus away from mouse users, but adds it back for keyboard users. Why you ask? Sometimes mouse users don’t like the focus ring around elements when they are being selected. (CLICK)

Slide 125

Slide 125

:focus-within Chris DeMars ! @saltnburnem (CLICK) 78 #ConnectTech #DeveloperCommunity

Slide 126

Slide 126

Chris DeMars ! @saltnburnem

  • The background of a parent element when its children are selected, gets focus. 79 #ConnectTech #DeveloperCommunity

Slide 127

Slide 127

Chris DeMars ! @saltnburnem 80 #ConnectTech #DeveloperCommunity

Slide 128

Slide 128

Chris DeMars ! @saltnburnem 80 #ConnectTech #DeveloperCommunity

Slide 129

Slide 129

Resources https://bit.ly/2OV9A63 Chris DeMars ! @saltnburnem 81 #ConnectTech #DeveloperCommunity