Grids All The Way Down @rachelandrew at Frontend United
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
CSS Grid Layout Two years on.
Slides & resources https://noti.st/rachelandrew
Slide 4
“I can make flexbox do anything. Why should I learn grid?”
Slides & resources https://noti.st/rachelandrew
Slide 5
“Should I use colour in this web design, or will fonts do?”
Slides & resources https://noti.st/rachelandrew
Slide 6
“Should I build my site using Flexbox or Grid?”
Slides & resources https://noti.st/rachelandrew
Slide 7
Stop thinking about Flexbox & Grid as two separate layout methods
Slides & resources https://noti.st/rachelandrew
Slide 8
Should I build my site using Flexbox or Grid?
YES.
Slides & resources https://noti.st/rachelandrew
Slide 9
Slides & resources https://noti.st/rachelandrew
Slide 10
Look at the pattern you need to build. That will tell you which layout method you need.
Slides & resources https://noti.st/rachelandrew
Slide 11
Flexbox when you have a bunch of different size stuff you want displayed in a readable way.
Slides & resources https://noti.st/rachelandrew
Slide 12
Slides & resources https://noti.st/rachelandrew
Slide 13
Grid for when you want to control the structure and place items into it.
Slides & resources https://noti.st/rachelandrew
Slide 14
Slides & resources https://noti.st/rachelandrew
Slide 15
If you are putting widths on all your flex items to make them line up. You probably want grid.
Slides & resources https://noti.st/rachelandrew
Two-dimensional Grid works in the same way in both axes.
Slides & resources https://noti.st/rachelandrew
Slide 21
Inline dimension: the grid fills the grid container
Block dimension: as tall as is needed for the content.
Slides & resources https://noti.st/rachelandrew
Slide 22
Inline dimension: the grid fills the grid container
Block dimension: the grid fills the grid container
Slides & resources https://noti.st/rachelandrew
Subgrid Create a grid on a grid item which uses the grid tracks defined on the parent – for rows, columns or both.
Slides & resources https://noti.st/rachelandrew
Line numbers start from 1 inside the subgrid. You position child items in the subgrid according to the subgrid line numbering, not those of the parent.
Slides & resources https://noti.st/rachelandrew
Slide 53
Slides & resources https://noti.st/rachelandrew
Slide 54
Line names on the parent are passed into the subgrid. If you have named lines on the parent grid they will be passed into the subgrid and added to any names defined there.
Slides & resources https://noti.st/rachelandrew
Write about features you want to see in browsers Write up your use cases, the problems having the feature will solve.
Slides & resources https://noti.st/rachelandrew
Slide 78
Use new features Browsers are watching.
Slides & resources https://noti.st/rachelandrew
Slide 79
Slides & resources https://noti.st/rachelandrew
Slide 80
Use new features when they are behind a flag You get to beta test the web platform!
Slides & resources https://noti.st/rachelandrew
Slide 81
Give feedback to the CSS Working Group https://github.com/w3c/csswg-drafts/issues
Slides & resources https://noti.st/rachelandrew
Slide 82
Slides & resources https://noti.st/rachelandrew
Slide 83
Participate in the web platform Or you are leaving your future as a designer or developer in the hands of the very few who do.
Slides & resources https://noti.st/rachelandrew
Slide 84
Thank you @rachelandrew
Slides & resources https://noti.st/rachelandrew