Refactoring (the way we talk about) CSS. Rachel Andrew @ CSS Day
Slides & resources https://noti.st/rachelandrew
Slide 2
Doing things on the web since 1996 Co-founder Perch CMS & Notist. Editor in Chief Smashing Magazine. Writer of many books. CSS Working Group Member representing Fronteers. Spec editor Multicol and Page Floats. MDN tech writer.
Slides & resources https://noti.st/rachelandrew
Slide 3
I thought that I had teaching CSS layout all figured out
Slides & resources https://noti.st/rachelandrew
Slide 4
Talking about CSS as a layout system
Slides & resources https://noti.st/rachelandrew
Slide 5
Teaching CSS in the same structured way we would any other language.
Slides & resources https://noti.st/rachelandrew
Slide 6
• • • • • • • • •
Flow Layout Changing the value of display Out of flow elements Block Formatting Contexts Writing Modes Logical, flow-relative properties and values Alignment Sizing Media & Feature Queries Slides & resources https://noti.st/rachelandrew
“[justify-content] does not apply to flex items, because there is more than one item in the main axis.”
Slides & resources https://noti.st/rachelandrew
“Prior to alignment via justifycontent and align-self, any positive free space is distributed to auto margins in that dimension.”
Slides & resources https://noti.st/rachelandrew
What is the inline-size or width of the box? By default, the content-box
Slides & resources https://noti.st/rachelandrew
Slide 77
If you want the specified width to include padding and border Set the box-sizing property to border-box.
Slides & resources https://noti.st/rachelandrew
Old browsers. They exist.
Slides & resources https://noti.st/rachelandrew
Slide 89
We have a specification. Some of it isn’t implemented yet.
Slides & resources https://noti.st/rachelandrew
Slide 90
Lack of support is very different to the buggy support of the past.
Slides & resources https://noti.st/rachelandrew
Slide 91
Media & Feature Queries How big is my viewport? Is this a touchscreen? Does this browser support Grid? Respond based on the answers.
Slides & resources https://noti.st/rachelandrew
Slide 92
We need to stop talking about and teaching CSS as a weird and quirky thing.
Slides & resources https://noti.st/rachelandrew
Slide 93
CSS is unlike other languages because it serves environments like no other.
Slides & resources https://noti.st/rachelandrew
Slide 94
Teach CSS as it is today.
Slides & resources https://noti.st/rachelandrew