SlideShare a Scribd company logo
WHAT I DISCOVERED ABOUT
LAYOUT VIA CSS GRID
@rachelandrew #cssday
What I discovered about layout vis CSS Grid
March 2017 March 2017 March 2017 March 2017 March 2017 Soooooon!
63.92%
It’s not CSS Vaporware!*





*I’m very happy about this
The more I know about CSS, the more
I realise I don’t know.
CSS Grid and friends
▸ CSS Display
▸ Writing Modes
▸ Logical Properties
▸ Box Alignment
▸ Feature Queries
CSS Display: https://drafts.csswg.org/css-display/
“This module describes how the CSS formatting
box tree is generated from the document
element tree and defines the display property
that controls it.”
CSS Display: https://drafts.csswg.org/css-display/
▸ The Outer Display Type - how does this box behave in relationship to its
parent?
▸ The Inner Display Type - what formatting context does it create for its child
elements?
CSS Grid: https://www.w3.org/TR/css-grid-1/#grid-item-display
“The display value of a grid item is blockified: if
the specified display of an in-flow child of an
element generating a grid container is an inline-
level value, it computes to its block-level
equivalent. ”
CSS Display: https://www.w3.org/TR/css-display/#transformations
“Some layout effects
require blockification or inlinification of the box
type, which sets the box’s outer display type, if it
is not none or contents,
to block or inline (respectively).”
<div class="grid">
<a href="">one</a>
<span>two</span>
<div>three</div>
<img src="img.png" alt="placeholder">
</div>
.grid {
display: grid;
grid-template-columns: repeat(4,200px);
grid-gap: 8px;
height: 200px;
border: 8px solid rgb(3,99,143);
}
Why is knowing this useful?
.wrapper {
max-width: 800px;
border-spacing: 20px;
}
.image {
display: table-cell;
}
.content {
display: table-cell;
vertical-align: top;
}
https://www.w3.org/TR/CSS2/tables.html#anonymous-boxes
“Any table element will automatically generate
necessary anonymous table objects around itself,
consisting of at least three nested objects
corresponding to a 'table'/'inline-table' element, a
'table-row' element, and a 'table-cell' element.”
CSS Grid: https://www.w3.org/TR/css-grid-1/#grid-item-display
“Note: Some values of display normally trigger the
creation of anonymous boxes around the original
box. If such a box is a grid item, it is blockified first,
and so anonymous box creation will not happen.
For example, two contiguous grid
items with display: table-cell will become two
separate display: block grid items, instead of being
wrapped into a single anonymous table.”
.wrapper {
max-width: 800px;
border-spacing: 20px;
display: grid;
grid-template-columns: auto 1fr;
grid-gap: 20px;
}
.image {
display: table-cell;
}
.content {
display: table-cell;
vertical-align: top;
}
https://codepen.io/rachelandrew/pen/KqMyzN
.grid {
max-width: 800px;
border-spacing: 20px;
display: grid;
grid-template-columns: auto 1fr;
grid-gap: 20px;
}
@supports (grid-gap: 20px) {
.grid {
margin: 20px;
}
}
.image {
display: table-cell;
}
.content {
display: table-cell;
vertical-align: top;
}
https://codepen.io/rachelandrew/pen/qjNVwG
Creating fallbacks
▸ You do not need to write two sets of code
▸ Write your fallback code and then write your grid code
▸ In many cases the spec has you covered
▸ Use Feature Queries to isolate things that would apply to both grid-supporting
and non-supporting browsers
https://rachelandrew.co.uk/css/cheatsheets/grid-fallbacks
What happened to subgrid?
What I discovered about layout vis CSS Grid
.grid {
display: grid;
max-width: 960px;
margin: 0 auto;
grid-template-columns: repeat(3, 1fr);
grid-gap: 20px;
}
CSS Grid
Creating a three column layout with
CSS Grid.
https://codepen.io/rachelandrew/pen/XgdydE
What I discovered about layout vis CSS Grid
.card {
display: flex;
flex-direction: column;
}
.card .inner {
flex: 1;
}
Make the card a flex item
Allow the inner to grow, it pushes the
footer down to the bottom of the
card.s
https://codepen.io/rachelandrew/pen/XgdydE
What I discovered about layout vis CSS Grid
1
2
3
4
5
.card {
border: 4px solid rgb(24,154,153);
background-color: #fff;
grid-row: auto / span 4;
display: subgrid;
}
display: subgrid
The card is a direct child of the grid
so needs to span four rows of the grid
to make room for the four rows in the
subgridded internals.



display: subgrid means the card now
uses the tracks of the parent grid.
What I discovered about layout vis CSS Grid
Subgrid links and thoughts
▸ https://rachelandrew.co.uk/archives/2017/03/16/subgrid-moved-to-level-2-
of-the-css-grid-specification/
▸ https://github.com/w3c/csswg-drafts/issues/958
▸ https://github.com/rachelandrew/cssgrid-ama/issues/13
▸ http://meyerweb.com/eric/thoughts/2016/01/15/subgrids-considered-
essential/
Vanishing boxes with display:contents
display: contents https://drafts.csswg.org/css-display/#box-generation
“The element itself does not generate any boxes,
but its children and pseudo-elements still
generate boxes as normal. For the purposes of
box generation and layout, the element must be
treated as if it had been replaced in the element
tree by its contents”
<div class="flex">
<div>One</div>
<div>Two</div>
<div class="nested">
<div>Nested One</div>
<div>Nested Two</div>
</div>
</div>
<div class="grid">
<div>One</div>
<div>Two</div>
<div class="nested">
<div>Nested One</div>
<div>Nested Two</div>
</div>
</div>
https://codepen.io/rachelandrew/pen/GEZPex
.flex {
display: flex;
border: 8px solid rgb(3,99,143);
}
.flex > * {
flex: 1;
border: 8px solid rgb(24,154,153);
}
.grid {
display: grid;
border: 8px solid rgb(3,99,143);
grid-template-columns:
repeat(4,minmax(200px, 1fr));
grid-gap: 8px;
}
.grid > * {
border: 8px solid rgb(24,154,153);
}
https://codepen.io/rachelandrew/pen/GEZPex
.nested {
display: contents;
}
https://codepen.io/rachelandrew/pen/GEZPex
Needs Firefox or Chrome Canary
.flex > * {
flex: 1;
border: 8px solid rgb(24,154,153);
}
.grid > * {
border: 8px solid rgb(24,154,153);
}
What I discovered about layout vis CSS Grid
.card {
border: 4px solid rgb(24,154,153);
background-color: #fff;
display: contents;
}
display: contents
We add this to the direct child of the
grid container.
https://codepen.io/rachelandrew/pen/QgNJYa
What I discovered about layout vis CSS Grid
1
2
3
4
5
.card {
border: 4px solid rgb(24,154,153);
background-color: #fff;
grid-row: auto / span 4;
display: contents;
}
Make room for the rows
Each card needs four rows.
.card:nth-child(1) h2{ grid-column: 1; grid-row: 1; }
.card:nth-child(1) img{ grid-column: 1; grid-row: 2; }
.card:nth-child(1) .inner{ grid-column: 1; grid-row: 3; }
.card:nth-child(1) footer{ grid-column: 1; grid-row: 4; }
.card:nth-child(2) h2{ grid-column: 2; grid-row: 1; }
.card:nth-child(2) img{ grid-column: 2; grid-row: 2; }
.card:nth-child(2) .inner{ grid-column: 2; grid-row: 3; }
.card:nth-child(2) footer{ grid-column: 2; grid-row: 4; }
.card:nth-child(3) h2{ grid-column: 3; grid-row: 1; }
.card:nth-child(3) img{ grid-column: 3; grid-row: 2; }
.card:nth-child(3) .inner{ grid-column: 3; grid-row: 3; }
.card:nth-child(3) footer{ grid-column: 3; grid-row: 4; }
.card:nth-child(4) h2{ grid-column: 1; grid-row: 5; }
.card:nth-child(4) img{ grid-column: 1; grid-row: 6; }
.card:nth-child(4) .inner{ grid-column: 1; grid-row: 7;}
.card:nth-child(4) footer{ grid-column: 1; grid-row: 8; }
.card:nth-child(5) h2{ grid-column: 2; grid-row: 5; }
.card:nth-child(5) img{ grid-column: 2; grid-row: 6; }
.card:nth-child(5) .inner{ grid-column: 2; grid-row: 7; }
.card:nth-child(5) footer{ grid-column: 2; grid-row: 8; }
.card:nth-child(6) h2{ grid-column: 3; grid-row: 5; }
.card:nth-child(6) img{ grid-column: 3; grid-row: 6; }
.card:nth-child(6) .inner{ grid-column: 3; grid-row: 7; }
.card:nth-child(6) footer{ grid-column: 3; grid-row: 8; }
Ugh.
Don’t do this.
https://codepen.io/rachelandrew/pen/QgNJYa
What I discovered about layout vis CSS Grid
display: contents
▸ Use when the element you are removing has no box styling (e.g. backgrounds
and borders) attached
▸ Current browser support Firefox, Chrome Canary
It is all logical.
/* this shorthand */
.a {
grid-area: 1 / 2 / 2 / 5;
}
/* is the same as this */
.a {
grid-row-start: 1;
grid-column-start: 2;
grid-row-end: 2;
grid-column-end: 5;
}
The order of values in grid-area
•row-start
•column-start
•row-end
•column-end
.grid {
display: grid;
grid-gap: 10px;
grid-template-columns: repeat(4, 150px);
grid-template-rows: repeat(3, 100px);
}
.a {
grid-area: 1 / 2 / 2 / 5;
}
.b {
grid-area: 1 / 1 / 3 / 4;
}
https://codepen.io/rachelandrew/pen/BZKbaN
.grid {
Direction: rtl;
display: grid;
grid-gap: 10px;
grid-template-columns: repeat(4, 150px);
grid-template-rows: repeat(3, 100px);
}
.a {
grid-area: 1 / 2 / 2 / 5;
}
.b {
grid-area: 1 / 1 / 3 / 4;
}
https://codepen.io/rachelandrew/pen/BZKbaN
CSS Logical Properties
“This module introduces logical properties and
values that provide the author with the ability to
control layout through logical, rather than physical,
direction and dimension mappings. The module
defines logical properties and values for the
features defined in CSS2.1. These properties are
writing-mode relative equivalents of their
corresponding physical properties.”
Logical not Physical
▸ The start of a page rather than the top
▸ The end of a block rather than the right
▸ In grid layout we have start and end for both columns and rows, rather than
referring to the top and bottom of columns and left and right of rows
.grid {
display: grid;
grid-gap: 10px;
grid-template-columns: repeat(3,
150px);
grid-template-rows: repeat(3, 100px);
justify-content: end;
align-content: end;
}
https://codepen.io/rachelandrew/pen/pwyBpG
End
End
Start
Start
direction: ltr
.grid {
display: grid;
grid-gap: 10px;
grid-template-columns: repeat(3,
150px);
grid-template-rows: repeat(3, 100px);
justify-content: end;
align-content: end;
}
https://codepen.io/rachelandrew/pen/pwyBpG
End
End
Start
Start
direction: rtl
https://rachelandrew.co.uk/css/cheatsheets/box-alignment
What’s in a name?
https://cloudfour.com/thinks/breaking-out-with-css-grid-layout/
.Prose {
display: grid;
grid-template-columns:
[full-start] minmax(1em, 1fr)
[main-start] minmax(0, 40em) [main-end]
minmax(1em, 1fr) [full-end];
}
.Prose > * {
grid-column: main;
}
.Prose-splash {
grid-column: full;
}
Just do this!
Magic occurs.
What I discovered about layout vis CSS Grid
<div class="grid">
<div>Content</div>
<div class="gallery">Full width
content</div>
<div>Content</div>
</div>
My markup
A div containing three direct child
elements, one with a class of ‘gallery’.
That’s our full width content.
.grid {
display: grid;
grid-template-columns:
minmax(1em, 1fr)
minmax(0, 660px)
minmax(1em, 1fr);
}
.grid > * {
grid-column: 2 ;
}
.grid > .gallery {
grid-column: 1 / -1 ;
}
A grid with 3 column tracks
Using the line numbers to place our
content and full width items.
https://codepen.io/rachelandrew/pen/mwOmJW
1 2 3 4
1 2 3 4
grid-column: 2;
grid-column: 1 / 4;
grid-column: 2;
What I discovered about layout vis CSS Grid
.grid {
display: grid;
grid-template-columns:
[full-start] minmax(1em, 1fr)
[main-start] minmax(0, 660px)
[main-end] minmax(1em, 1fr)
[full-end];
}
.grid > * {
grid-column: main-start;
}
.grid > .gallery {
grid-column: full-start / full-end;
}
Naming lines on the grid
We can now position the items using
their line names.
https://codepen.io/rachelandrew/pen/EXjrJM
full-start main-start main-end full-end
grid-column: main-start;
grid-column: full-start / full-end;
full-start main-start main-end full-end
grid-column: main-start;
grid-column: main;
grid-column: full;
full-start main-start main-end full-end
grid-column: main;
.grid {
display: grid;
max-width: 960px;
margin: 0 auto;
grid-template-columns: [full-start]
minmax(1em, 1fr)
[main-start] minmax(0, 660px) [main-end]
minmax(1em, 1fr) [full-end];
}
.grid > * {
grid-column: main;
}
.grid > .gallery {
grid-column: full;
}
‘main’ and ‘full’
These line names don’t exist
anywhere in our grid definition.
https://www.w3.org/TR/css-grid-1/#implicit-named-areas
“Since a named grid area is referenced by the
implicit named lines it produces, explicitly adding
named lines of the same form (foo-start/foo-end)
effectively creates a named grid area. ”
main-start
main-start
main-end
main-end
main
.grid {
display: grid;
grid-gap: 20px;
grid-template-columns:
100px [main-start]
100px 100px 100px [main-end]
100px 100px;
grid-template-rows:
100px [main-start]
100px 100px [main-end] 100px;
}
.item {
grid-area: main;
}
Implicit named areas
Created by having named lines using
an ident with *-start and *-end.
https://codepen.io/rachelandrew/pen/EXNmvj
.grid {
display: grid;
grid-template-columns: [full-start]
minmax(1em, 1fr)
[main-start] minmax(0, 660px) [main-
end]
minmax(1em, 1fr) [full-end];
grid-template-rows: auto auto [full-
start] auto [full-end];
}
.grid > * {
grid-column: main-start;
}
.grid > .gallery {
grid-area: full;
}
Magic named area
We have defined lines named full-
start and full-end for rows and
columns so we have an area named
full.
https://codepen.io/rachelandrew/pen/jwPjWK
https://www.w3.org/TR/css-grid-1/#line-placement
“Note: Named grid areas automatically generate
implicit named lines of this form, so specifying
grid-row-start: foo will choose the start edge of
that named grid area (unless another line named
foo-start was explicitly specified before it).”
Named lines create a named area
which in turn can be used as
named lines.
https://www.w3.org/TR/css-grid-1/#placement-shorthands
“[when using grid-row and grid-column
shorthands] … When the second value is omitted,
if the first value is a <custom-ident>, the grid-row-
end/grid-column-end longhand is also set to
that <custom-ident>; otherwise, it is set to auto.”
grid-column: main;
grid-column: full;
full-start main-start main-end full-end
grid-column: main;
grid-column: main / main;
grid-column: full / full;
full-start main-start main-end full-end
grid-column: main / main;
full fullmain main
.grid {
display: grid;
max-width: 960px;
margin: 0 auto;
grid-template-columns: [full-start]
minmax(1em, 1fr)
[main-start] minmax(0, 660px) [main-end]
minmax(1em, 1fr) [full-end];
}
.grid > * {
grid-column: main;
}
.grid > .gallery {
grid-column: full;
}
Targeting the column track
The line name ‘main’ is created from
the named area created by our
named lines.
https://codepen.io/rachelandrew/pen/owXKMd
What I discovered about layout vis CSS Grid
.grid {
display: grid;
grid-template-columns: [full-start panel1-start]
1fr 1fr [content-start] 1fr 1fr 1fr 1fr [panel1-
end panel2-start ] 1fr 1fr 1fr 1fr [content-end]
1fr 1fr [panel2-end full-end] ;
}
.grid > * {
grid-column: content;
}
.grid > .gallery {
grid-column: full;
}
.grid > .panel1 {
grid-column: panel1;
padding: 4px;
}
.grid > .panel2 {
grid-column: panel2;
padding: 4px;
}
Extending the example
Adding named areas panel1 and
panel2.
https://codepen.io/rachelandrew/pen/YQXmJJ/
.grid {
display: grid;
grid-template-columns: minmax(1em,
1fr) minmax(0, 660px) minmax(1em, 1fr);
grid-template-areas:
". title ."
". content-top ."
"full-width full-width full-width"
". content-bottom ."
}
h1 { grid-area: title; }
.content1 { grid-area: content-top; }
.content2 { grid-area: content-bottom; }
.gallery { grid-area: full-width; }
Magic Grid Lines
If you have a named area you get grid
lines named *-start and *-end for rows
and columns.
https://codepen.io/rachelandrew/pen/qjdzwR
What I discovered about layout vis CSS Grid
.grid {
display: grid;
grid-template-columns: minmax(1em,
1fr) minmax(0, 660px) minmax(1em, 1fr);
grid-template-areas:
". title ."
". content-top ."
"full-width full-width full-width"
". content-bottom ."
}
h1 { grid-area: title; }
.content1 { grid-area: content-top; }
.content2 { grid-area: content-bottom; }
.gallery { grid-area: full-width; }
Magic Grid Lines
Each grid-area creates a set of lines
for the start and end of the area -
rows and columns.
For title, we have title-start and title-
end for rows and columns.
https://codepen.io/rachelandrew/pen/qjdzwR
.grid::after {
content: "";
background-color: #fff;
border: 4px solid rgb(182,222,211);
grid-column:
content-top-start / content-top-end;
grid-row:
title-start / content-bottom-end;
z-index: -1;
}
Magic Lines
Positioning some generated content
using the magical lines.
https://codepen.io/rachelandrew/pen/qjdzwR
What I discovered about layout vis CSS Grid
Things appearing 

in unexpected places.
.grid {
display: grid;
grid-gap: 10px;
grid-template-columns: 100px [main-start]
100px 100px [main-end];
}
.a {
grid-column: 1 / 3;
grid-row: 1;
}
.b {
grid-column: 3;
grid-row: 1 / 3;
}
.c {
grid-column: 1;
}
.d {
grid-column: 2;
grid-row: 2;
}
https://codepen.io/rachelandrew/pen/JJYxve/
.grid {
display: grid;
grid-gap: 10px;
grid-template-columns: 100px [main-
start] 100px 100px [main-end];
}
.e {
grid-area: main;
}
https://codepen.io/rachelandrew/pen/JJYxve/
.grid {
display: grid;
grid-gap: 10px;
grid-template-columns: 100px [main-
start] 100px 100px [main-end];
}
.e {
grid-area: auto/ main;
}
https://codepen.io/rachelandrew/pen/JJYxve/
So many possibilities.
Find out more
I made you some resources
Visit Grid by Example for worked examples, patterns with
fallbacks, and a free video tutorial:

gridbyexample.com
I created a huge set of guides for MDN: 

https://developer.mozilla.org/en-US/docs/Web/CSS/
CSS_Grid_Layout
Over 4 years of grid thoughts on my site at:

https://rachelandrew.co.uk/archives/tag/cssgrid
CSS Grid AMA:

https://github.com/rachelandrew/cssgrid-ama 

THANK YOU!
@rachelandrew



Resources & code: https://rachelandrew.co.uk/speaking/event/cssday-nl-2017

More Related Content

What's hot (20)

Introducing CSS Grid Layout
Introducing CSS Grid LayoutIntroducing CSS Grid Layout
Introducing CSS Grid Layout
Rachel Andrew
 
CSS Grid for html5j
CSS Grid for html5jCSS Grid for html5j
CSS Grid for html5j
Rachel Andrew
 
CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout
Rachel Andrew
 
Laracon Online: Grid and Flexbox
Laracon Online: Grid and FlexboxLaracon Online: Grid and Flexbox
Laracon Online: Grid and Flexbox
Rachel Andrew
 
CSS Grid Layout
CSS Grid LayoutCSS Grid Layout
CSS Grid Layout
Rachel Andrew
 
CSSConf.asia - Laying out the future
CSSConf.asia - Laying out the futureCSSConf.asia - Laying out the future
CSSConf.asia - Laying out the future
Rachel Andrew
 
Flexbox and Grid Layout
Flexbox and Grid LayoutFlexbox and Grid Layout
Flexbox and Grid Layout
Rachel Andrew
 
CSS Grid Layout: An Event Apart Boston 2016
CSS Grid Layout: An Event Apart Boston 2016CSS Grid Layout: An Event Apart Boston 2016
CSS Grid Layout: An Event Apart Boston 2016
Rachel Andrew
 
Solving Layout Problems with CSS Grid & Friends - WEBU17
Solving Layout Problems with CSS Grid & Friends - WEBU17Solving Layout Problems with CSS Grid & Friends - WEBU17
Solving Layout Problems with CSS Grid & Friends - WEBU17
Rachel Andrew
 
New CSS Meets the Real World
New CSS Meets the Real WorldNew CSS Meets the Real World
New CSS Meets the Real World
Rachel Andrew
 
Confoo: You can use CSS for that!
Confoo: You can use CSS for that!Confoo: You can use CSS for that!
Confoo: You can use CSS for that!
Rachel Andrew
 
The New CSS Layout - dotCSS
The New CSS Layout - dotCSSThe New CSS Layout - dotCSS
The New CSS Layout - dotCSS
Rachel Andrew
 
Next-level CSS
Next-level CSSNext-level CSS
Next-level CSS
Rachel Andrew
 
Confoo: The New CSS Layout
Confoo: The New CSS LayoutConfoo: The New CSS Layout
Confoo: The New CSS Layout
Rachel Andrew
 
CSS Grid Layout for Frontend NE
CSS Grid Layout for Frontend NECSS Grid Layout for Frontend NE
CSS Grid Layout for Frontend NE
Rachel Andrew
 
Future Layout & Performance
Future Layout & PerformanceFuture Layout & Performance
Future Layout & Performance
Rachel Andrew
 
CSS Grid
CSS GridCSS Grid
CSS Grid
Digital Surgeons
 
Laying out the future
Laying out the futureLaying out the future
Laying out the future
Rachel Andrew
 
Making the most of New CSS Layout
Making the most of New CSS LayoutMaking the most of New CSS Layout
Making the most of New CSS Layout
Rachel Andrew
 
Introduction to CSS Grid Layout
Introduction to CSS Grid LayoutIntroduction to CSS Grid Layout
Introduction to CSS Grid Layout
Rachel Andrew
 
Introducing CSS Grid Layout
Introducing CSS Grid LayoutIntroducing CSS Grid Layout
Introducing CSS Grid Layout
Rachel Andrew
 
CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout
Rachel Andrew
 
Laracon Online: Grid and Flexbox
Laracon Online: Grid and FlexboxLaracon Online: Grid and Flexbox
Laracon Online: Grid and Flexbox
Rachel Andrew
 
CSSConf.asia - Laying out the future
CSSConf.asia - Laying out the futureCSSConf.asia - Laying out the future
CSSConf.asia - Laying out the future
Rachel Andrew
 
Flexbox and Grid Layout
Flexbox and Grid LayoutFlexbox and Grid Layout
Flexbox and Grid Layout
Rachel Andrew
 
CSS Grid Layout: An Event Apart Boston 2016
CSS Grid Layout: An Event Apart Boston 2016CSS Grid Layout: An Event Apart Boston 2016
CSS Grid Layout: An Event Apart Boston 2016
Rachel Andrew
 
Solving Layout Problems with CSS Grid & Friends - WEBU17
Solving Layout Problems with CSS Grid & Friends - WEBU17Solving Layout Problems with CSS Grid & Friends - WEBU17
Solving Layout Problems with CSS Grid & Friends - WEBU17
Rachel Andrew
 
New CSS Meets the Real World
New CSS Meets the Real WorldNew CSS Meets the Real World
New CSS Meets the Real World
Rachel Andrew
 
Confoo: You can use CSS for that!
Confoo: You can use CSS for that!Confoo: You can use CSS for that!
Confoo: You can use CSS for that!
Rachel Andrew
 
The New CSS Layout - dotCSS
The New CSS Layout - dotCSSThe New CSS Layout - dotCSS
The New CSS Layout - dotCSS
Rachel Andrew
 
Confoo: The New CSS Layout
Confoo: The New CSS LayoutConfoo: The New CSS Layout
Confoo: The New CSS Layout
Rachel Andrew
 
CSS Grid Layout for Frontend NE
CSS Grid Layout for Frontend NECSS Grid Layout for Frontend NE
CSS Grid Layout for Frontend NE
Rachel Andrew
 
Future Layout & Performance
Future Layout & PerformanceFuture Layout & Performance
Future Layout & Performance
Rachel Andrew
 
Laying out the future
Laying out the futureLaying out the future
Laying out the future
Rachel Andrew
 
Making the most of New CSS Layout
Making the most of New CSS LayoutMaking the most of New CSS Layout
Making the most of New CSS Layout
Rachel Andrew
 
Introduction to CSS Grid Layout
Introduction to CSS Grid LayoutIntroduction to CSS Grid Layout
Introduction to CSS Grid Layout
Rachel Andrew
 

Similar to What I discovered about layout vis CSS Grid (19)

View Source London: Solving Layout Problems with CSS Grid & Friends
View Source London: Solving Layout Problems with CSS Grid & FriendsView Source London: Solving Layout Problems with CSS Grid & Friends
View Source London: Solving Layout Problems with CSS Grid & Friends
Rachel Andrew
 
Solving Layout Problems with CSS Grid & Friends - DevFest17
Solving Layout Problems with CSS Grid & Friends - DevFest17Solving Layout Problems with CSS Grid & Friends - DevFest17
Solving Layout Problems with CSS Grid & Friends - DevFest17
Rachel Andrew
 
Solving Layout Problems with CSS Grid & Friends - NordicJS
Solving Layout Problems with CSS Grid & Friends - NordicJSSolving Layout Problems with CSS Grid & Friends - NordicJS
Solving Layout Problems with CSS Grid & Friends - NordicJS
Rachel Andrew
 
404.ie: Solving Layout Problems with CSS Grid & Friends
404.ie: Solving Layout Problems with CSS Grid & Friends404.ie: Solving Layout Problems with CSS Grid & Friends
404.ie: Solving Layout Problems with CSS Grid & Friends
Rachel Andrew
 
CSS Grid Layout
CSS Grid LayoutCSS Grid Layout
CSS Grid Layout
All Things Open
 
CSS Grid Layout - An Event Apart Orlando
CSS Grid Layout - An Event Apart OrlandoCSS Grid Layout - An Event Apart Orlando
CSS Grid Layout - An Event Apart Orlando
Rachel Andrew
 
CSS Grid Layout
CSS Grid LayoutCSS Grid Layout
CSS Grid Layout
Rachel Andrew
 
CSS Grid Layout for Topconf, Linz
CSS Grid Layout for Topconf, LinzCSS Grid Layout for Topconf, Linz
CSS Grid Layout for Topconf, Linz
Rachel Andrew
 
Devoxx Belgium: CSS Grid Layout
Devoxx Belgium: CSS Grid LayoutDevoxx Belgium: CSS Grid Layout
Devoxx Belgium: CSS Grid Layout
Rachel Andrew
 
An Event Apart SF: CSS Grid Layout
An Event Apart SF: CSS Grid LayoutAn Event Apart SF: CSS Grid Layout
An Event Apart SF: CSS Grid Layout
Rachel Andrew
 
DevFest Nantes - Start Using CSS Grid Layout today
DevFest Nantes - Start Using CSS Grid Layout todayDevFest Nantes - Start Using CSS Grid Layout today
DevFest Nantes - Start Using CSS Grid Layout today
Rachel Andrew
 
An Event Apart Nashville: CSS Grid Layout
An Event Apart Nashville: CSS Grid LayoutAn Event Apart Nashville: CSS Grid Layout
An Event Apart Nashville: CSS Grid Layout
Rachel Andrew
 
Laying out the future with grid & flexbox - Smashing Conf Freiburg
Laying out the future with grid & flexbox - Smashing Conf FreiburgLaying out the future with grid & flexbox - Smashing Conf Freiburg
Laying out the future with grid & flexbox - Smashing Conf Freiburg
Rachel Andrew
 
Start Using CSS Grid Layout Today - RuhrJS
Start Using CSS Grid Layout Today - RuhrJSStart Using CSS Grid Layout Today - RuhrJS
Start Using CSS Grid Layout Today - RuhrJS
Rachel Andrew
 
Fluent: Making Sense of the New CSS Layout
Fluent: Making Sense of the New CSS LayoutFluent: Making Sense of the New CSS Layout
Fluent: Making Sense of the New CSS Layout
Rachel Andrew
 
Introduction to CSS Grid
Introduction to CSS GridIntroduction to CSS Grid
Introduction to CSS Grid
Kara Luton
 
Introduction to CSS Grid
Introduction to CSS GridIntroduction to CSS Grid
Introduction to CSS Grid
Kara Luton
 
Graduating to Grid
Graduating to GridGraduating to Grid
Graduating to Grid
Rachel Andrew
 
Grids of Tomorrow: CSS Grid Layout
Grids of Tomorrow: CSS Grid LayoutGrids of Tomorrow: CSS Grid Layout
Grids of Tomorrow: CSS Grid Layout
Simone Lelli
 
View Source London: Solving Layout Problems with CSS Grid & Friends
View Source London: Solving Layout Problems with CSS Grid & FriendsView Source London: Solving Layout Problems with CSS Grid & Friends
View Source London: Solving Layout Problems with CSS Grid & Friends
Rachel Andrew
 
Solving Layout Problems with CSS Grid & Friends - DevFest17
Solving Layout Problems with CSS Grid & Friends - DevFest17Solving Layout Problems with CSS Grid & Friends - DevFest17
Solving Layout Problems with CSS Grid & Friends - DevFest17
Rachel Andrew
 
Solving Layout Problems with CSS Grid & Friends - NordicJS
Solving Layout Problems with CSS Grid & Friends - NordicJSSolving Layout Problems with CSS Grid & Friends - NordicJS
Solving Layout Problems with CSS Grid & Friends - NordicJS
Rachel Andrew
 
404.ie: Solving Layout Problems with CSS Grid & Friends
404.ie: Solving Layout Problems with CSS Grid & Friends404.ie: Solving Layout Problems with CSS Grid & Friends
404.ie: Solving Layout Problems with CSS Grid & Friends
Rachel Andrew
 
CSS Grid Layout - An Event Apart Orlando
CSS Grid Layout - An Event Apart OrlandoCSS Grid Layout - An Event Apart Orlando
CSS Grid Layout - An Event Apart Orlando
Rachel Andrew
 
CSS Grid Layout for Topconf, Linz
CSS Grid Layout for Topconf, LinzCSS Grid Layout for Topconf, Linz
CSS Grid Layout for Topconf, Linz
Rachel Andrew
 
Devoxx Belgium: CSS Grid Layout
Devoxx Belgium: CSS Grid LayoutDevoxx Belgium: CSS Grid Layout
Devoxx Belgium: CSS Grid Layout
Rachel Andrew
 
An Event Apart SF: CSS Grid Layout
An Event Apart SF: CSS Grid LayoutAn Event Apart SF: CSS Grid Layout
An Event Apart SF: CSS Grid Layout
Rachel Andrew
 
DevFest Nantes - Start Using CSS Grid Layout today
DevFest Nantes - Start Using CSS Grid Layout todayDevFest Nantes - Start Using CSS Grid Layout today
DevFest Nantes - Start Using CSS Grid Layout today
Rachel Andrew
 
An Event Apart Nashville: CSS Grid Layout
An Event Apart Nashville: CSS Grid LayoutAn Event Apart Nashville: CSS Grid Layout
An Event Apart Nashville: CSS Grid Layout
Rachel Andrew
 
Laying out the future with grid & flexbox - Smashing Conf Freiburg
Laying out the future with grid & flexbox - Smashing Conf FreiburgLaying out the future with grid & flexbox - Smashing Conf Freiburg
Laying out the future with grid & flexbox - Smashing Conf Freiburg
Rachel Andrew
 
Start Using CSS Grid Layout Today - RuhrJS
Start Using CSS Grid Layout Today - RuhrJSStart Using CSS Grid Layout Today - RuhrJS
Start Using CSS Grid Layout Today - RuhrJS
Rachel Andrew
 
Fluent: Making Sense of the New CSS Layout
Fluent: Making Sense of the New CSS LayoutFluent: Making Sense of the New CSS Layout
Fluent: Making Sense of the New CSS Layout
Rachel Andrew
 
Introduction to CSS Grid
Introduction to CSS GridIntroduction to CSS Grid
Introduction to CSS Grid
Kara Luton
 
Introduction to CSS Grid
Introduction to CSS GridIntroduction to CSS Grid
Introduction to CSS Grid
Kara Luton
 
Grids of Tomorrow: CSS Grid Layout
Grids of Tomorrow: CSS Grid LayoutGrids of Tomorrow: CSS Grid Layout
Grids of Tomorrow: CSS Grid Layout
Simone Lelli
 

More from Rachel Andrew (11)

All Day Hey! Unlocking The Power of CSS Grid Layout
All Day Hey! Unlocking The Power of CSS Grid LayoutAll Day Hey! Unlocking The Power of CSS Grid Layout
All Day Hey! Unlocking The Power of CSS Grid Layout
Rachel Andrew
 
SmashingConf SF: Unlocking the Power of CSS Grid Layout
SmashingConf SF: Unlocking the Power of CSS Grid LayoutSmashingConf SF: Unlocking the Power of CSS Grid Layout
SmashingConf SF: Unlocking the Power of CSS Grid Layout
Rachel Andrew
 
Unlocking the Power of CSS Grid Layout
Unlocking the Power of CSS Grid LayoutUnlocking the Power of CSS Grid Layout
Unlocking the Power of CSS Grid Layout
Rachel Andrew
 
The Creative New World of CSS
The Creative New World of CSSThe Creative New World of CSS
The Creative New World of CSS
Rachel Andrew
 
Into the Weeds of CSS Layout
Into the Weeds of CSS LayoutInto the Weeds of CSS Layout
Into the Weeds of CSS Layout
Rachel Andrew
 
Google Developers Experts Summit 2017 - CSS Layout
Google Developers Experts Summit 2017 - CSS Layout Google Developers Experts Summit 2017 - CSS Layout
Google Developers Experts Summit 2017 - CSS Layout
Rachel Andrew
 
Web Summer Camp Keynote
Web Summer Camp KeynoteWeb Summer Camp Keynote
Web Summer Camp Keynote
Rachel Andrew
 
New CSS Layout Meets the Real World
New CSS Layout Meets the Real WorldNew CSS Layout Meets the Real World
New CSS Layout Meets the Real World
Rachel Andrew
 
An Event Apart DC - New CSS Layout meets the Real World
An Event Apart DC - New CSS Layout meets the Real WorldAn Event Apart DC - New CSS Layout meets the Real World
An Event Apart DC - New CSS Layout meets the Real World
Rachel Andrew
 
Perch, Patterns and Old Browsers
Perch, Patterns and Old BrowsersPerch, Patterns and Old Browsers
Perch, Patterns and Old Browsers
Rachel Andrew
 
Where does CSS come from?
Where does CSS come from?Where does CSS come from?
Where does CSS come from?
Rachel Andrew
 
All Day Hey! Unlocking The Power of CSS Grid Layout
All Day Hey! Unlocking The Power of CSS Grid LayoutAll Day Hey! Unlocking The Power of CSS Grid Layout
All Day Hey! Unlocking The Power of CSS Grid Layout
Rachel Andrew
 
SmashingConf SF: Unlocking the Power of CSS Grid Layout
SmashingConf SF: Unlocking the Power of CSS Grid LayoutSmashingConf SF: Unlocking the Power of CSS Grid Layout
SmashingConf SF: Unlocking the Power of CSS Grid Layout
Rachel Andrew
 
Unlocking the Power of CSS Grid Layout
Unlocking the Power of CSS Grid LayoutUnlocking the Power of CSS Grid Layout
Unlocking the Power of CSS Grid Layout
Rachel Andrew
 
The Creative New World of CSS
The Creative New World of CSSThe Creative New World of CSS
The Creative New World of CSS
Rachel Andrew
 
Into the Weeds of CSS Layout
Into the Weeds of CSS LayoutInto the Weeds of CSS Layout
Into the Weeds of CSS Layout
Rachel Andrew
 
Google Developers Experts Summit 2017 - CSS Layout
Google Developers Experts Summit 2017 - CSS Layout Google Developers Experts Summit 2017 - CSS Layout
Google Developers Experts Summit 2017 - CSS Layout
Rachel Andrew
 
Web Summer Camp Keynote
Web Summer Camp KeynoteWeb Summer Camp Keynote
Web Summer Camp Keynote
Rachel Andrew
 
New CSS Layout Meets the Real World
New CSS Layout Meets the Real WorldNew CSS Layout Meets the Real World
New CSS Layout Meets the Real World
Rachel Andrew
 
An Event Apart DC - New CSS Layout meets the Real World
An Event Apart DC - New CSS Layout meets the Real WorldAn Event Apart DC - New CSS Layout meets the Real World
An Event Apart DC - New CSS Layout meets the Real World
Rachel Andrew
 
Perch, Patterns and Old Browsers
Perch, Patterns and Old BrowsersPerch, Patterns and Old Browsers
Perch, Patterns and Old Browsers
Rachel Andrew
 
Where does CSS come from?
Where does CSS come from?Where does CSS come from?
Where does CSS come from?
Rachel Andrew
 

Recently uploaded (20)

Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)
Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)
Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)
HusseinMalikMammadli
 
Build your own NES Emulator... with Kotlin
Build your own NES Emulator... with KotlinBuild your own NES Emulator... with Kotlin
Build your own NES Emulator... with Kotlin
Artur Skowroński
 
Partner Tableau Next Product First Call Deck.pdf
Partner Tableau Next Product First Call Deck.pdfPartner Tableau Next Product First Call Deck.pdf
Partner Tableau Next Product First Call Deck.pdf
ssuser3d62c6
 
PSEP - Salesforce Power of the Platform.pdf
PSEP - Salesforce Power of the Platform.pdfPSEP - Salesforce Power of the Platform.pdf
PSEP - Salesforce Power of the Platform.pdf
ssuser3d62c6
 
Building Connected Agents: An Overview of Google's ADK and A2A Protocol
Building Connected Agents:  An Overview of Google's ADK and A2A ProtocolBuilding Connected Agents:  An Overview of Google's ADK and A2A Protocol
Building Connected Agents: An Overview of Google's ADK and A2A Protocol
Suresh Peiris
 
NVIDIA’s Enterprise AI Factory and Blueprints_ Paving the Way for Smart, Scal...
NVIDIA’s Enterprise AI Factory and Blueprints_ Paving the Way for Smart, Scal...NVIDIA’s Enterprise AI Factory and Blueprints_ Paving the Way for Smart, Scal...
NVIDIA’s Enterprise AI Factory and Blueprints_ Paving the Way for Smart, Scal...
derrickjswork
 
MuleSoft RTF & Flex Gateway on AKS – Setup, Insights & Real-World Tips
MuleSoft RTF & Flex Gateway on AKS – Setup, Insights & Real-World TipsMuleSoft RTF & Flex Gateway on AKS – Setup, Insights & Real-World Tips
MuleSoft RTF & Flex Gateway on AKS – Setup, Insights & Real-World Tips
Patryk Bandurski
 
Dr Schwarzkopf presentation on STKI Summit A
Dr Schwarzkopf presentation on STKI Summit ADr Schwarzkopf presentation on STKI Summit A
Dr Schwarzkopf presentation on STKI Summit A
Dr. Jimmy Schwarzkopf
 
Artificial Intelligence (Kecerdasan Buatan).pdf
Artificial Intelligence (Kecerdasan Buatan).pdfArtificial Intelligence (Kecerdasan Buatan).pdf
Artificial Intelligence (Kecerdasan Buatan).pdf
NufiEriKusumawati
 
Automating Call Centers with AI Agents_ Achieving Sub-700ms Latency.docx
Automating Call Centers with AI Agents_ Achieving Sub-700ms Latency.docxAutomating Call Centers with AI Agents_ Achieving Sub-700ms Latency.docx
Automating Call Centers with AI Agents_ Achieving Sub-700ms Latency.docx
Ihor Hamal
 
TrustArc Webinar: Cross-Border Data Transfers in 2025
TrustArc Webinar: Cross-Border Data Transfers in 2025TrustArc Webinar: Cross-Border Data Transfers in 2025
TrustArc Webinar: Cross-Border Data Transfers in 2025
TrustArc
 
"AI in the browser: predicting user actions in real time with TensorflowJS", ...
"AI in the browser: predicting user actions in real time with TensorflowJS", ..."AI in the browser: predicting user actions in real time with TensorflowJS", ...
"AI in the browser: predicting user actions in real time with TensorflowJS", ...
Fwdays
 
Four Principles for Physically Interpretable World Models (poster)
Four Principles for Physically Interpretable World Models (poster)Four Principles for Physically Interpretable World Models (poster)
Four Principles for Physically Interpretable World Models (poster)
Ivan Ruchkin
 
AI needs Hybrid Cloud - TEC conference 2025.pptx
AI needs Hybrid Cloud - TEC conference 2025.pptxAI needs Hybrid Cloud - TEC conference 2025.pptx
AI needs Hybrid Cloud - TEC conference 2025.pptx
Shikha Srivastava
 
Planetek Italia Corporate Profile Brochure
Planetek Italia Corporate Profile BrochurePlanetek Italia Corporate Profile Brochure
Planetek Italia Corporate Profile Brochure
Planetek Italia Srl
 
Fully Open-Source Private Clouds: Freedom, Security, and Control
Fully Open-Source Private Clouds: Freedom, Security, and ControlFully Open-Source Private Clouds: Freedom, Security, and Control
Fully Open-Source Private Clouds: Freedom, Security, and Control
ShapeBlue
 
AI in Java - MCP in Action, Langchain4J-CDI, SmallRye-LLM, Spring AI
AI in Java - MCP in Action, Langchain4J-CDI, SmallRye-LLM, Spring AIAI in Java - MCP in Action, Langchain4J-CDI, SmallRye-LLM, Spring AI
AI in Java - MCP in Action, Langchain4J-CDI, SmallRye-LLM, Spring AI
Buhake Sindi
 
Managing Geospatial Open Data Serverlessly [AWS Community Day CH 2025]
Managing Geospatial Open Data Serverlessly [AWS Community Day CH 2025]Managing Geospatial Open Data Serverlessly [AWS Community Day CH 2025]
Managing Geospatial Open Data Serverlessly [AWS Community Day CH 2025]
Chris Bingham
 
Stretching CloudStack over multiple datacenters
Stretching CloudStack over multiple datacentersStretching CloudStack over multiple datacenters
Stretching CloudStack over multiple datacenters
ShapeBlue
 
TAFs on WebDriver API - By - Pallavi Sharma.pdf
TAFs on WebDriver API - By - Pallavi Sharma.pdfTAFs on WebDriver API - By - Pallavi Sharma.pdf
TAFs on WebDriver API - By - Pallavi Sharma.pdf
Pallavi Sharma
 
Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)
Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)
Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)
HusseinMalikMammadli
 
Build your own NES Emulator... with Kotlin
Build your own NES Emulator... with KotlinBuild your own NES Emulator... with Kotlin
Build your own NES Emulator... with Kotlin
Artur Skowroński
 
Partner Tableau Next Product First Call Deck.pdf
Partner Tableau Next Product First Call Deck.pdfPartner Tableau Next Product First Call Deck.pdf
Partner Tableau Next Product First Call Deck.pdf
ssuser3d62c6
 
PSEP - Salesforce Power of the Platform.pdf
PSEP - Salesforce Power of the Platform.pdfPSEP - Salesforce Power of the Platform.pdf
PSEP - Salesforce Power of the Platform.pdf
ssuser3d62c6
 
Building Connected Agents: An Overview of Google's ADK and A2A Protocol
Building Connected Agents:  An Overview of Google's ADK and A2A ProtocolBuilding Connected Agents:  An Overview of Google's ADK and A2A Protocol
Building Connected Agents: An Overview of Google's ADK and A2A Protocol
Suresh Peiris
 
NVIDIA’s Enterprise AI Factory and Blueprints_ Paving the Way for Smart, Scal...
NVIDIA’s Enterprise AI Factory and Blueprints_ Paving the Way for Smart, Scal...NVIDIA’s Enterprise AI Factory and Blueprints_ Paving the Way for Smart, Scal...
NVIDIA’s Enterprise AI Factory and Blueprints_ Paving the Way for Smart, Scal...
derrickjswork
 
MuleSoft RTF & Flex Gateway on AKS – Setup, Insights & Real-World Tips
MuleSoft RTF & Flex Gateway on AKS – Setup, Insights & Real-World TipsMuleSoft RTF & Flex Gateway on AKS – Setup, Insights & Real-World Tips
MuleSoft RTF & Flex Gateway on AKS – Setup, Insights & Real-World Tips
Patryk Bandurski
 
Dr Schwarzkopf presentation on STKI Summit A
Dr Schwarzkopf presentation on STKI Summit ADr Schwarzkopf presentation on STKI Summit A
Dr Schwarzkopf presentation on STKI Summit A
Dr. Jimmy Schwarzkopf
 
Artificial Intelligence (Kecerdasan Buatan).pdf
Artificial Intelligence (Kecerdasan Buatan).pdfArtificial Intelligence (Kecerdasan Buatan).pdf
Artificial Intelligence (Kecerdasan Buatan).pdf
NufiEriKusumawati
 
Automating Call Centers with AI Agents_ Achieving Sub-700ms Latency.docx
Automating Call Centers with AI Agents_ Achieving Sub-700ms Latency.docxAutomating Call Centers with AI Agents_ Achieving Sub-700ms Latency.docx
Automating Call Centers with AI Agents_ Achieving Sub-700ms Latency.docx
Ihor Hamal
 
TrustArc Webinar: Cross-Border Data Transfers in 2025
TrustArc Webinar: Cross-Border Data Transfers in 2025TrustArc Webinar: Cross-Border Data Transfers in 2025
TrustArc Webinar: Cross-Border Data Transfers in 2025
TrustArc
 
"AI in the browser: predicting user actions in real time with TensorflowJS", ...
"AI in the browser: predicting user actions in real time with TensorflowJS", ..."AI in the browser: predicting user actions in real time with TensorflowJS", ...
"AI in the browser: predicting user actions in real time with TensorflowJS", ...
Fwdays
 
Four Principles for Physically Interpretable World Models (poster)
Four Principles for Physically Interpretable World Models (poster)Four Principles for Physically Interpretable World Models (poster)
Four Principles for Physically Interpretable World Models (poster)
Ivan Ruchkin
 
AI needs Hybrid Cloud - TEC conference 2025.pptx
AI needs Hybrid Cloud - TEC conference 2025.pptxAI needs Hybrid Cloud - TEC conference 2025.pptx
AI needs Hybrid Cloud - TEC conference 2025.pptx
Shikha Srivastava
 
Planetek Italia Corporate Profile Brochure
Planetek Italia Corporate Profile BrochurePlanetek Italia Corporate Profile Brochure
Planetek Italia Corporate Profile Brochure
Planetek Italia Srl
 
Fully Open-Source Private Clouds: Freedom, Security, and Control
Fully Open-Source Private Clouds: Freedom, Security, and ControlFully Open-Source Private Clouds: Freedom, Security, and Control
Fully Open-Source Private Clouds: Freedom, Security, and Control
ShapeBlue
 
AI in Java - MCP in Action, Langchain4J-CDI, SmallRye-LLM, Spring AI
AI in Java - MCP in Action, Langchain4J-CDI, SmallRye-LLM, Spring AIAI in Java - MCP in Action, Langchain4J-CDI, SmallRye-LLM, Spring AI
AI in Java - MCP in Action, Langchain4J-CDI, SmallRye-LLM, Spring AI
Buhake Sindi
 
Managing Geospatial Open Data Serverlessly [AWS Community Day CH 2025]
Managing Geospatial Open Data Serverlessly [AWS Community Day CH 2025]Managing Geospatial Open Data Serverlessly [AWS Community Day CH 2025]
Managing Geospatial Open Data Serverlessly [AWS Community Day CH 2025]
Chris Bingham
 
Stretching CloudStack over multiple datacenters
Stretching CloudStack over multiple datacentersStretching CloudStack over multiple datacenters
Stretching CloudStack over multiple datacenters
ShapeBlue
 
TAFs on WebDriver API - By - Pallavi Sharma.pdf
TAFs on WebDriver API - By - Pallavi Sharma.pdfTAFs on WebDriver API - By - Pallavi Sharma.pdf
TAFs on WebDriver API - By - Pallavi Sharma.pdf
Pallavi Sharma
 

What I discovered about layout vis CSS Grid

  • 1. WHAT I DISCOVERED ABOUT LAYOUT VIA CSS GRID @rachelandrew #cssday
  • 3. March 2017 March 2017 March 2017 March 2017 March 2017 Soooooon!
  • 5. It’s not CSS Vaporware!*
 
 
 *I’m very happy about this
  • 6. The more I know about CSS, the more I realise I don’t know.
  • 7. CSS Grid and friends ▸ CSS Display ▸ Writing Modes ▸ Logical Properties ▸ Box Alignment ▸ Feature Queries
  • 8. CSS Display: https://drafts.csswg.org/css-display/ “This module describes how the CSS formatting box tree is generated from the document element tree and defines the display property that controls it.”
  • 9. CSS Display: https://drafts.csswg.org/css-display/ ▸ The Outer Display Type - how does this box behave in relationship to its parent? ▸ The Inner Display Type - what formatting context does it create for its child elements?
  • 10. CSS Grid: https://www.w3.org/TR/css-grid-1/#grid-item-display “The display value of a grid item is blockified: if the specified display of an in-flow child of an element generating a grid container is an inline- level value, it computes to its block-level equivalent. ”
  • 11. CSS Display: https://www.w3.org/TR/css-display/#transformations “Some layout effects require blockification or inlinification of the box type, which sets the box’s outer display type, if it is not none or contents, to block or inline (respectively).”
  • 13. .grid { display: grid; grid-template-columns: repeat(4,200px); grid-gap: 8px; height: 200px; border: 8px solid rgb(3,99,143); }
  • 14. Why is knowing this useful?
  • 15. .wrapper { max-width: 800px; border-spacing: 20px; } .image { display: table-cell; } .content { display: table-cell; vertical-align: top; }
  • 16. https://www.w3.org/TR/CSS2/tables.html#anonymous-boxes “Any table element will automatically generate necessary anonymous table objects around itself, consisting of at least three nested objects corresponding to a 'table'/'inline-table' element, a 'table-row' element, and a 'table-cell' element.”
  • 17. CSS Grid: https://www.w3.org/TR/css-grid-1/#grid-item-display “Note: Some values of display normally trigger the creation of anonymous boxes around the original box. If such a box is a grid item, it is blockified first, and so anonymous box creation will not happen. For example, two contiguous grid items with display: table-cell will become two separate display: block grid items, instead of being wrapped into a single anonymous table.”
  • 18. .wrapper { max-width: 800px; border-spacing: 20px; display: grid; grid-template-columns: auto 1fr; grid-gap: 20px; } .image { display: table-cell; } .content { display: table-cell; vertical-align: top; } https://codepen.io/rachelandrew/pen/KqMyzN
  • 19. .grid { max-width: 800px; border-spacing: 20px; display: grid; grid-template-columns: auto 1fr; grid-gap: 20px; } @supports (grid-gap: 20px) { .grid { margin: 20px; } } .image { display: table-cell; } .content { display: table-cell; vertical-align: top; } https://codepen.io/rachelandrew/pen/qjNVwG
  • 20. Creating fallbacks ▸ You do not need to write two sets of code ▸ Write your fallback code and then write your grid code ▸ In many cases the spec has you covered ▸ Use Feature Queries to isolate things that would apply to both grid-supporting and non-supporting browsers
  • 22. What happened to subgrid?
  • 24. .grid { display: grid; max-width: 960px; margin: 0 auto; grid-template-columns: repeat(3, 1fr); grid-gap: 20px; } CSS Grid Creating a three column layout with CSS Grid. https://codepen.io/rachelandrew/pen/XgdydE
  • 26. .card { display: flex; flex-direction: column; } .card .inner { flex: 1; } Make the card a flex item Allow the inner to grow, it pushes the footer down to the bottom of the card.s https://codepen.io/rachelandrew/pen/XgdydE
  • 29. .card { border: 4px solid rgb(24,154,153); background-color: #fff; grid-row: auto / span 4; display: subgrid; } display: subgrid The card is a direct child of the grid so needs to span four rows of the grid to make room for the four rows in the subgridded internals.
 
 display: subgrid means the card now uses the tracks of the parent grid.
  • 31. Subgrid links and thoughts ▸ https://rachelandrew.co.uk/archives/2017/03/16/subgrid-moved-to-level-2- of-the-css-grid-specification/ ▸ https://github.com/w3c/csswg-drafts/issues/958 ▸ https://github.com/rachelandrew/cssgrid-ama/issues/13 ▸ http://meyerweb.com/eric/thoughts/2016/01/15/subgrids-considered- essential/
  • 32. Vanishing boxes with display:contents
  • 33. display: contents https://drafts.csswg.org/css-display/#box-generation “The element itself does not generate any boxes, but its children and pseudo-elements still generate boxes as normal. For the purposes of box generation and layout, the element must be treated as if it had been replaced in the element tree by its contents”
  • 34. <div class="flex"> <div>One</div> <div>Two</div> <div class="nested"> <div>Nested One</div> <div>Nested Two</div> </div> </div> <div class="grid"> <div>One</div> <div>Two</div> <div class="nested"> <div>Nested One</div> <div>Nested Two</div> </div> </div> https://codepen.io/rachelandrew/pen/GEZPex
  • 35. .flex { display: flex; border: 8px solid rgb(3,99,143); } .flex > * { flex: 1; border: 8px solid rgb(24,154,153); } .grid { display: grid; border: 8px solid rgb(3,99,143); grid-template-columns: repeat(4,minmax(200px, 1fr)); grid-gap: 8px; } .grid > * { border: 8px solid rgb(24,154,153); } https://codepen.io/rachelandrew/pen/GEZPex
  • 37. .flex > * { flex: 1; border: 8px solid rgb(24,154,153); } .grid > * { border: 8px solid rgb(24,154,153); }
  • 39. .card { border: 4px solid rgb(24,154,153); background-color: #fff; display: contents; } display: contents We add this to the direct child of the grid container. https://codepen.io/rachelandrew/pen/QgNJYa
  • 42. .card { border: 4px solid rgb(24,154,153); background-color: #fff; grid-row: auto / span 4; display: contents; } Make room for the rows Each card needs four rows.
  • 43. .card:nth-child(1) h2{ grid-column: 1; grid-row: 1; } .card:nth-child(1) img{ grid-column: 1; grid-row: 2; } .card:nth-child(1) .inner{ grid-column: 1; grid-row: 3; } .card:nth-child(1) footer{ grid-column: 1; grid-row: 4; } .card:nth-child(2) h2{ grid-column: 2; grid-row: 1; } .card:nth-child(2) img{ grid-column: 2; grid-row: 2; } .card:nth-child(2) .inner{ grid-column: 2; grid-row: 3; } .card:nth-child(2) footer{ grid-column: 2; grid-row: 4; } .card:nth-child(3) h2{ grid-column: 3; grid-row: 1; } .card:nth-child(3) img{ grid-column: 3; grid-row: 2; } .card:nth-child(3) .inner{ grid-column: 3; grid-row: 3; } .card:nth-child(3) footer{ grid-column: 3; grid-row: 4; } .card:nth-child(4) h2{ grid-column: 1; grid-row: 5; } .card:nth-child(4) img{ grid-column: 1; grid-row: 6; } .card:nth-child(4) .inner{ grid-column: 1; grid-row: 7;} .card:nth-child(4) footer{ grid-column: 1; grid-row: 8; } .card:nth-child(5) h2{ grid-column: 2; grid-row: 5; } .card:nth-child(5) img{ grid-column: 2; grid-row: 6; } .card:nth-child(5) .inner{ grid-column: 2; grid-row: 7; } .card:nth-child(5) footer{ grid-column: 2; grid-row: 8; } .card:nth-child(6) h2{ grid-column: 3; grid-row: 5; } .card:nth-child(6) img{ grid-column: 3; grid-row: 6; } .card:nth-child(6) .inner{ grid-column: 3; grid-row: 7; } .card:nth-child(6) footer{ grid-column: 3; grid-row: 8; } Ugh. Don’t do this. https://codepen.io/rachelandrew/pen/QgNJYa
  • 45. display: contents ▸ Use when the element you are removing has no box styling (e.g. backgrounds and borders) attached ▸ Current browser support Firefox, Chrome Canary
  • 46. It is all logical.
  • 47. /* this shorthand */ .a { grid-area: 1 / 2 / 2 / 5; } /* is the same as this */ .a { grid-row-start: 1; grid-column-start: 2; grid-row-end: 2; grid-column-end: 5; } The order of values in grid-area •row-start •column-start •row-end •column-end
  • 48. .grid { display: grid; grid-gap: 10px; grid-template-columns: repeat(4, 150px); grid-template-rows: repeat(3, 100px); } .a { grid-area: 1 / 2 / 2 / 5; } .b { grid-area: 1 / 1 / 3 / 4; } https://codepen.io/rachelandrew/pen/BZKbaN
  • 49. .grid { Direction: rtl; display: grid; grid-gap: 10px; grid-template-columns: repeat(4, 150px); grid-template-rows: repeat(3, 100px); } .a { grid-area: 1 / 2 / 2 / 5; } .b { grid-area: 1 / 1 / 3 / 4; } https://codepen.io/rachelandrew/pen/BZKbaN
  • 50. CSS Logical Properties “This module introduces logical properties and values that provide the author with the ability to control layout through logical, rather than physical, direction and dimension mappings. The module defines logical properties and values for the features defined in CSS2.1. These properties are writing-mode relative equivalents of their corresponding physical properties.”
  • 51. Logical not Physical ▸ The start of a page rather than the top ▸ The end of a block rather than the right ▸ In grid layout we have start and end for both columns and rows, rather than referring to the top and bottom of columns and left and right of rows
  • 52. .grid { display: grid; grid-gap: 10px; grid-template-columns: repeat(3, 150px); grid-template-rows: repeat(3, 100px); justify-content: end; align-content: end; } https://codepen.io/rachelandrew/pen/pwyBpG End End Start Start direction: ltr
  • 53. .grid { display: grid; grid-gap: 10px; grid-template-columns: repeat(3, 150px); grid-template-rows: repeat(3, 100px); justify-content: end; align-content: end; } https://codepen.io/rachelandrew/pen/pwyBpG End End Start Start direction: rtl
  • 55. What’s in a name?
  • 57. .Prose { display: grid; grid-template-columns: [full-start] minmax(1em, 1fr) [main-start] minmax(0, 40em) [main-end] minmax(1em, 1fr) [full-end]; } .Prose > * { grid-column: main; } .Prose-splash { grid-column: full; } Just do this! Magic occurs.
  • 59. <div class="grid"> <div>Content</div> <div class="gallery">Full width content</div> <div>Content</div> </div> My markup A div containing three direct child elements, one with a class of ‘gallery’. That’s our full width content.
  • 60. .grid { display: grid; grid-template-columns: minmax(1em, 1fr) minmax(0, 660px) minmax(1em, 1fr); } .grid > * { grid-column: 2 ; } .grid > .gallery { grid-column: 1 / -1 ; } A grid with 3 column tracks Using the line numbers to place our content and full width items. https://codepen.io/rachelandrew/pen/mwOmJW
  • 61. 1 2 3 4
  • 62. 1 2 3 4 grid-column: 2; grid-column: 1 / 4; grid-column: 2;
  • 64. .grid { display: grid; grid-template-columns: [full-start] minmax(1em, 1fr) [main-start] minmax(0, 660px) [main-end] minmax(1em, 1fr) [full-end]; } .grid > * { grid-column: main-start; } .grid > .gallery { grid-column: full-start / full-end; } Naming lines on the grid We can now position the items using their line names. https://codepen.io/rachelandrew/pen/EXjrJM
  • 66. grid-column: main-start; grid-column: full-start / full-end; full-start main-start main-end full-end grid-column: main-start;
  • 67. grid-column: main; grid-column: full; full-start main-start main-end full-end grid-column: main;
  • 68. .grid { display: grid; max-width: 960px; margin: 0 auto; grid-template-columns: [full-start] minmax(1em, 1fr) [main-start] minmax(0, 660px) [main-end] minmax(1em, 1fr) [full-end]; } .grid > * { grid-column: main; } .grid > .gallery { grid-column: full; } ‘main’ and ‘full’ These line names don’t exist anywhere in our grid definition.
  • 69. https://www.w3.org/TR/css-grid-1/#implicit-named-areas “Since a named grid area is referenced by the implicit named lines it produces, explicitly adding named lines of the same form (foo-start/foo-end) effectively creates a named grid area. ”
  • 71. .grid { display: grid; grid-gap: 20px; grid-template-columns: 100px [main-start] 100px 100px 100px [main-end] 100px 100px; grid-template-rows: 100px [main-start] 100px 100px [main-end] 100px; } .item { grid-area: main; } Implicit named areas Created by having named lines using an ident with *-start and *-end. https://codepen.io/rachelandrew/pen/EXNmvj
  • 72. .grid { display: grid; grid-template-columns: [full-start] minmax(1em, 1fr) [main-start] minmax(0, 660px) [main- end] minmax(1em, 1fr) [full-end]; grid-template-rows: auto auto [full- start] auto [full-end]; } .grid > * { grid-column: main-start; } .grid > .gallery { grid-area: full; } Magic named area We have defined lines named full- start and full-end for rows and columns so we have an area named full. https://codepen.io/rachelandrew/pen/jwPjWK
  • 73. https://www.w3.org/TR/css-grid-1/#line-placement “Note: Named grid areas automatically generate implicit named lines of this form, so specifying grid-row-start: foo will choose the start edge of that named grid area (unless another line named foo-start was explicitly specified before it).”
  • 74. Named lines create a named area which in turn can be used as named lines.
  • 75. https://www.w3.org/TR/css-grid-1/#placement-shorthands “[when using grid-row and grid-column shorthands] … When the second value is omitted, if the first value is a <custom-ident>, the grid-row- end/grid-column-end longhand is also set to that <custom-ident>; otherwise, it is set to auto.”
  • 76. grid-column: main; grid-column: full; full-start main-start main-end full-end grid-column: main;
  • 77. grid-column: main / main; grid-column: full / full; full-start main-start main-end full-end grid-column: main / main; full fullmain main
  • 78. .grid { display: grid; max-width: 960px; margin: 0 auto; grid-template-columns: [full-start] minmax(1em, 1fr) [main-start] minmax(0, 660px) [main-end] minmax(1em, 1fr) [full-end]; } .grid > * { grid-column: main; } .grid > .gallery { grid-column: full; } Targeting the column track The line name ‘main’ is created from the named area created by our named lines. https://codepen.io/rachelandrew/pen/owXKMd
  • 80. .grid { display: grid; grid-template-columns: [full-start panel1-start] 1fr 1fr [content-start] 1fr 1fr 1fr 1fr [panel1- end panel2-start ] 1fr 1fr 1fr 1fr [content-end] 1fr 1fr [panel2-end full-end] ; } .grid > * { grid-column: content; } .grid > .gallery { grid-column: full; } .grid > .panel1 { grid-column: panel1; padding: 4px; } .grid > .panel2 { grid-column: panel2; padding: 4px; } Extending the example Adding named areas panel1 and panel2. https://codepen.io/rachelandrew/pen/YQXmJJ/
  • 81. .grid { display: grid; grid-template-columns: minmax(1em, 1fr) minmax(0, 660px) minmax(1em, 1fr); grid-template-areas: ". title ." ". content-top ." "full-width full-width full-width" ". content-bottom ." } h1 { grid-area: title; } .content1 { grid-area: content-top; } .content2 { grid-area: content-bottom; } .gallery { grid-area: full-width; } Magic Grid Lines If you have a named area you get grid lines named *-start and *-end for rows and columns. https://codepen.io/rachelandrew/pen/qjdzwR
  • 83. .grid { display: grid; grid-template-columns: minmax(1em, 1fr) minmax(0, 660px) minmax(1em, 1fr); grid-template-areas: ". title ." ". content-top ." "full-width full-width full-width" ". content-bottom ." } h1 { grid-area: title; } .content1 { grid-area: content-top; } .content2 { grid-area: content-bottom; } .gallery { grid-area: full-width; } Magic Grid Lines Each grid-area creates a set of lines for the start and end of the area - rows and columns. For title, we have title-start and title- end for rows and columns. https://codepen.io/rachelandrew/pen/qjdzwR
  • 84. .grid::after { content: ""; background-color: #fff; border: 4px solid rgb(182,222,211); grid-column: content-top-start / content-top-end; grid-row: title-start / content-bottom-end; z-index: -1; } Magic Lines Positioning some generated content using the magical lines. https://codepen.io/rachelandrew/pen/qjdzwR
  • 86. Things appearing 
 in unexpected places.
  • 87. .grid { display: grid; grid-gap: 10px; grid-template-columns: 100px [main-start] 100px 100px [main-end]; } .a { grid-column: 1 / 3; grid-row: 1; } .b { grid-column: 3; grid-row: 1 / 3; } .c { grid-column: 1; } .d { grid-column: 2; grid-row: 2; } https://codepen.io/rachelandrew/pen/JJYxve/
  • 88. .grid { display: grid; grid-gap: 10px; grid-template-columns: 100px [main- start] 100px 100px [main-end]; } .e { grid-area: main; } https://codepen.io/rachelandrew/pen/JJYxve/
  • 89. .grid { display: grid; grid-gap: 10px; grid-template-columns: 100px [main- start] 100px 100px [main-end]; } .e { grid-area: auto/ main; } https://codepen.io/rachelandrew/pen/JJYxve/
  • 91. Find out more I made you some resources Visit Grid by Example for worked examples, patterns with fallbacks, and a free video tutorial:
 gridbyexample.com I created a huge set of guides for MDN: 
 https://developer.mozilla.org/en-US/docs/Web/CSS/ CSS_Grid_Layout Over 4 years of grid thoughts on my site at:
 https://rachelandrew.co.uk/archives/tag/cssgrid CSS Grid AMA:
 https://github.com/rachelandrew/cssgrid-ama 

  • 92. THANK YOU! @rachelandrew
 
 Resources & code: https://rachelandrew.co.uk/speaking/event/cssday-nl-2017