SlideShare a Scribd company logo
SIMONE LELLI
UI Designer & Developer @ Objectway
I like drawing, coding and cooking…
...COOKING?
YES! WE'RE GOING TO COOK AMAZING
LAYOUTS!
CSS GRID: WHY I'M ENTHUSIAST
I was a graphic designer
converted to web.
I love UI design and development.
CREATIVITY VS "FORCED" LAYOUT SOLUTIONS
-.-
Tables
Inline blocks
Floats
Flexbox
They are all hacks like this: it looks like an hamburger... but it is a veggie-burger...
...IF YOU WANT A REAL BURGER...
...YOU HAVE TO TAKE A STEP TO THE FUTURE!
Grids of Tomorrow: CSS Grid Layout
WHY SHOULD I LEARN IT TODAY?
TO BE COOL :)
TO DRIVE YOUR TEAM TOMORROW!
WHAT IS IT CSS GRID LAYOUT
MODULE?
Two-dimensional grid layout system
You can use media queries
You can order child elements as you want
HOW CAN I TRY IT NOW?
CHROME
chrome://flags/#enable-experimental-web-platform-
features
FIREFOX
set true layout.css.grid.enabled inside about:config
IE 10-11, EDGE
-ms- prefix early implementation (with some differences)
CSS GRID LAYOUT
TERMINOLOGY
GRID LINES
They can be referred to by numbers or they can be named.
GRID TRACK
The space between two tracks (horizontal or vertical)
GRID CELL
The smallest unit of the grid (space between four tracks).
It's something like a table cell.
GRID AREA
Any area bounded by four lines: it may contain different grid
cells.
GRID GUTTERS
Useful for cases with regular gutter sizes.
DEFINE THE GRID
A grid is defined by a new value of display property:
display: grid
HTML
Define a container with 6 child elements
<div class="grid-wrapper">
<div class="item a">A</div>
<div class="item b">B</div>
<div class="item c">C</div>
<div class="item d">D</div>
<div class="item e">E</div>
<div class="item f">F</div>
</div>
CSS
Defines a grid of 5 columns and 3 rows with different size
.grid-wrapper {
display: grid;
grid-template-columns: 30% 5% 30% 5% 30%;
grid-template-rows: 200px 20px 200px;
}
A B C D E
F
Auto-placement: each item fill the first available cell
but we don't want items inside gutter columns.
HOW TO PUT EACH ITEM IN THE RIGHT PLACE
.a {
grid-column-start: 1;
grid-column-end: 2;
grid-row-start: 1;
grid-row-end: 2;
}
/* SHORTHAND */
.a {
grid-column: 1/2;
grid-row: 1/2;
}
A B C
D E F
Now each item is placed in the right place.
A grid area can span as many cells you want…
A B
C D
A
B
C D
…in all directions and position…
A
BC D
E
Place items where you want! No order problems or
limitations :)
GRID GUTTERS
A B
C D
.table {
grid-row-gap: 20px;
grid-column-gap: 20px;
}
/* Shorthand: row, column */
.table {
grid-gap: 20px 20px;
}
SOMETHING MORE...
You can span a grid area trough cells by lines numbers or
with span keyword: with span you can say "start at line 1
and span 4 lines".
.item {
grid-column: 1 / span 4;
}
/* IS THE SAME OF */
.item {
grid-column: 1 / 5;
}
NAMED LINES
.grid-wrapper {
display: grid;
grid-template-columns: [col1-start] 200px [col1-end] 15px [col2-start
grid-template-rows: [row1-start] 200px [row1-end] 15px [row2-start]
}
POSITIONING ITEMS USING NAMED
LINES
.item.a {
display: grid;
grid-column: col1-start / col1-end;
grid-row: row1-start / row1-end;
}
MAGIC AREAS!
Header
Content
Primary
sidebar
Secondary
sidebar
Footer
Define named areas:
each item is assoaciated to a named area
.header {grid-area: header;}
.content {grid-area: content;}
.sidebar-a {grid-area: sidebar-a;}
.sidebar-b {grid-area: sidebar-b;}
.footer {grid-area: footer;}
Define grid and place named areas
something like ASCII-art!
.grid-wrapper {
display: grid;
grid-template-columns: 30% 5% 30% 5% 30%;
grid-template-rows: 200px 20px 200px;
grid-template-areas:
"header header header header header"
". . . . ."
"sidebar-a . content . sidebar-b"
". . . . ."
"footer footer footer footer footer"
}
FUNNY CODE, PERFECT RESULT
Header
Content
Primary
sidebar
Secondary
sidebar
Footer
VERY EASY TO CHANGE!
Header
Content
Primary
sidebar
Secondary sidebar Footer
.grid-wrapper.change {
grid-template-areas:
"sidebar-a . content content content"
". . . . ."
"sidebar-b sidebar-b sidebar-b . footer"
". . . . ."
"header header header header header"
}
REPEAT
ANOTHER USEFUL FEATURE
EASY REPEAT A COLUMN/ROW PATTERN AS MANY TIMES
YOU WANT!
.grid-wrapper {
display: grid;
grid-template-columns: repeat(12, [gutter] 10px [col] 1fr);
grid-template-row: repeat(24, [gutter] 10px [row] 80px);
}
THE "FR" UNIT
The fr unit (fraction of available space) can be used for grid-
rows and grid-columns values.
It works as percentages for available space when fixed-sized
and content-based columns/rows have taken their space.
Bye bye Bootstrap,
bye bye Foundation...
ONE MORE FUNNY THING…
OVERLAP
A B C
D F
G
E
control overlaps with z-index
NEXT STEP: NESTED GRIDS
Header
SUB-GRID
SUB-GRID CONTENT
SUB-GRID FOOTER
SUB-GRID
SIDEBAR
Primary
sidebar
Secondary
sidebar
Footer
Outer grid contains another grid defined by display: grid
property. Nested grid is independent by parent.
Nested grids can't inherit column widths from the parent.
. . .
grid: subgrid can do it
but actually is not supported by browsers.
Subgird feature is at-risk
and may be dropped during the CR period.
RESPONSIVE DESIGN
CSS grids can be fully managed inside media queries:
you have great control and unbelievable possibilities for
web layouts.
Redefine elements position and size is very easy.
If you want you could also redefine your grid.
!!! WOOOOOOOOOOOOOOOW !!!
CSS GRID LAYOUT
VS
FLEXBOX
CSS GRID LAYOUT + FLEXBOX
Grid is the best for complex page layouts
Grid is two-dimensional and supports non-linear design
Flexbox is the ideal solution for small page components
Flexbox is one-dimensional and supports linear design;
remember that it works on axis (column and row
direction).
CSS Grid avoids redundant markup!
A WELL-BALANCED MIX OF GRID AND FLEX
IS THE KEY OF BETTER PERFORMANCE.
THAT'S COOL, BUT IN REALITY?
CHROME has the most advanced implementation (Blink).
SAFARI is close to Chrome implementation, prefixed -webkit
on nightlies.
FIREFOX is in development.
IE10+ & EDGE have a working but outdated implementation.
The update to current spec is high priority in backlog.
STATE OF THE SPECIFICATION
Currently Working Dra Level 1: 17 September 2015
Plans to move it forward to Last Call Working Dra
before CR.
USEFUL LINKS
W3C Working Dra
https://www.w3.org/TR/css-grid-1
W3C Editor's Dra
https://dra s.csswg.org/css-grid-1
Polyfill (by Fremy Company)
https://github.com/FremyCompany/css-grid-polyfill
Codepen examples: , ,1 2 3
ENJOY IT!
Thank you ;)
Characters in GIFs are of the respective owners. I'm sorry if I broke some copyright but it wasn't for commercial purposes.

More Related Content

What's hot (20)

PDF
The New CSS Layout - dotCSS
Rachel Andrew
 
PDF
CSS Grid Layout for Topconf, Linz
Rachel Andrew
 
PDF
CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017
Morten Rand-Hendriksen
 
PDF
CSS Grid Layout. Implementation status and roadmap (Webkit Contributors Meeti...
Igalia
 
PDF
CSS Grid Layout
Rachel Andrew
 
PDF
CSS Grid Layout: An Event Apart Boston 2016
Rachel Andrew
 
PPTX
Introducing CSS Grid
Jason Yingling
 
PDF
Fluent: Making Sense of the New CSS Layout
Rachel Andrew
 
PDF
Future Layout & Performance
Rachel Andrew
 
PDF
Flexbox and Grid Layout
Rachel Andrew
 
PDF
Flexbox and Grid Layout
Rachel Andrew
 
PDF
Frontend United: Start using CSS Grid Layout today!
Rachel Andrew
 
PDF
World of CSS Grid
Elad Shechter
 
PDF
CSS Grid Layout Introduction
Ajara I. Pfannenschmidt
 
PDF
Grid and Flexbox - Smashing Conf SF
Rachel Andrew
 
PDF
Render Conf: Start using CSS Grid Layout Today
Rachel Andrew
 
PDF
CSS Grid Layout - All Things Open
Rachel Andrew
 
PDF
Talk Web Design: Get Ready For CSS Grid Layout
Rachel Andrew
 
PDF
AEA Chicago CSS Grid Layout
Rachel Andrew
 
PDF
Introducing CSS Grid Layout
Rachel Andrew
 
The New CSS Layout - dotCSS
Rachel Andrew
 
CSS Grid Layout for Topconf, Linz
Rachel Andrew
 
CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017
Morten Rand-Hendriksen
 
CSS Grid Layout. Implementation status and roadmap (Webkit Contributors Meeti...
Igalia
 
CSS Grid Layout
Rachel Andrew
 
CSS Grid Layout: An Event Apart Boston 2016
Rachel Andrew
 
Introducing CSS Grid
Jason Yingling
 
Fluent: Making Sense of the New CSS Layout
Rachel Andrew
 
Future Layout & Performance
Rachel Andrew
 
Flexbox and Grid Layout
Rachel Andrew
 
Flexbox and Grid Layout
Rachel Andrew
 
Frontend United: Start using CSS Grid Layout today!
Rachel Andrew
 
World of CSS Grid
Elad Shechter
 
CSS Grid Layout Introduction
Ajara I. Pfannenschmidt
 
Grid and Flexbox - Smashing Conf SF
Rachel Andrew
 
Render Conf: Start using CSS Grid Layout Today
Rachel Andrew
 
CSS Grid Layout - All Things Open
Rachel Andrew
 
Talk Web Design: Get Ready For CSS Grid Layout
Rachel Andrew
 
AEA Chicago CSS Grid Layout
Rachel Andrew
 
Introducing CSS Grid Layout
Rachel Andrew
 

Viewers also liked (20)

PDF
ES2015 New Features
Giacomo Zinetti
 
PDF
The Great State of Design with CSS Grid Layout and Friends
Stacy Kvernmo
 
PDF
CSS Grid layout - De volta para o futuro
Afonso Pacifer
 
PDF
CSS from the future
Giacomo Zinetti
 
PPTX
Page layout & design task 2
Craig Cassidy
 
PDF
Writ Petition Criminal NO.......of 2017 vide D.NO.3913 against Registrar Supr...
Om Prakash Poddar
 
PPTX
Культурна Адаптація
Alyona Owens
 
PDF
Optimize your workflow
Adam Lowe Creative
 
PDF
CSS Grid Layout
All Things Open
 
PPTX
Metodiskā darba aptauja par 2016. gadu
Limbažu Galvenā bibliotēka
 
PDF
Appeal against Lodgment Order of Registrar SCI under Order XV Rule 5 of SCI R...
Om Prakash Poddar
 
PDF
CSS Grid Layout from the inside out (HTML5DevConf Autumn 2015)
Igalia
 
PDF
CSS Grid Layout w/ Blueprint CSS
Steve Hong
 
PDF
Grid system introduction
ananda gunadharma
 
DOCX
ТАСО 2016
Parusnik55
 
PDF
Post-Modern CSS: Start learning CSS Grid, Flexbox and other new properties
Bryan Robinson
 
PDF
The Best Practices of Symantec Code Signing - RapidSSLonline
RapidSSLOnline.com
 
PPTX
Presentation2
Richie Merkz
 
PDF
Layout, principles
Johannes Henseler
 
DOCX
Task 3B evaluation of final desgin
Gaetan Lundula
 
ES2015 New Features
Giacomo Zinetti
 
The Great State of Design with CSS Grid Layout and Friends
Stacy Kvernmo
 
CSS Grid layout - De volta para o futuro
Afonso Pacifer
 
CSS from the future
Giacomo Zinetti
 
Page layout & design task 2
Craig Cassidy
 
Writ Petition Criminal NO.......of 2017 vide D.NO.3913 against Registrar Supr...
Om Prakash Poddar
 
Культурна Адаптація
Alyona Owens
 
Optimize your workflow
Adam Lowe Creative
 
CSS Grid Layout
All Things Open
 
Metodiskā darba aptauja par 2016. gadu
Limbažu Galvenā bibliotēka
 
Appeal against Lodgment Order of Registrar SCI under Order XV Rule 5 of SCI R...
Om Prakash Poddar
 
CSS Grid Layout from the inside out (HTML5DevConf Autumn 2015)
Igalia
 
CSS Grid Layout w/ Blueprint CSS
Steve Hong
 
Grid system introduction
ananda gunadharma
 
ТАСО 2016
Parusnik55
 
Post-Modern CSS: Start learning CSS Grid, Flexbox and other new properties
Bryan Robinson
 
The Best Practices of Symantec Code Signing - RapidSSLonline
RapidSSLOnline.com
 
Presentation2
Richie Merkz
 
Layout, principles
Johannes Henseler
 
Task 3B evaluation of final desgin
Gaetan Lundula
 
Ad

Similar to Grids of Tomorrow: CSS Grid Layout (20)

PDF
CSS3 Layout
Zoe Gillenwater
 
PPTX
Css Grid Layout - A Short Introduction - Part 1
Adam Michalowski
 
PDF
The Grid - The Future of CSS Layout
Ronny Siikaluoma
 
PDF
Web I - 07 - CSS Frameworks
Randy Connolly
 
PDF
CSS Grid Layout
Rachel Andrew
 
PDF
Introduction to CSS Grid
Kara Luton
 
PDF
The Future State of Layout
Stephen Hay
 
PDF
Laying out the future with grid & flexbox - Smashing Conf Freiburg
Rachel Andrew
 
PPT
17523630.ppt
ssusere2bc36
 
PDF
Evergreen websites for Evergreen browsers
Rachel Andrew
 
PPTX
Full Stack Development CSS_Layouts,Grid,FlexboxPPT.pptx
ganeshchettipalli
 
PDF
The Future of CSS Layout
Zoe Gillenwater
 
PPTX
2D Page Layout
Unfold UI
 
PPTX
CSS Flexbox and Grid: The future of website layouts - DN Scrum Breakfast - Au...
Scrum Breakfast Vietnam
 
PDF
DevFest Nantes - Start Using CSS Grid Layout today
Rachel Andrew
 
PDF
Solving Layout Problems with CSS Grid & Friends - DevFest17
Rachel Andrew
 
PDF
Introduction to CSS Grid
Kara Luton
 
PDF
What I discovered about layout vis CSS Grid
Rachel Andrew
 
PDF
View Source London: Solving Layout Problems with CSS Grid & Friends
Rachel Andrew
 
PDF
Start Using CSS Grid Layout Today - RuhrJS
Rachel Andrew
 
CSS3 Layout
Zoe Gillenwater
 
Css Grid Layout - A Short Introduction - Part 1
Adam Michalowski
 
The Grid - The Future of CSS Layout
Ronny Siikaluoma
 
Web I - 07 - CSS Frameworks
Randy Connolly
 
CSS Grid Layout
Rachel Andrew
 
Introduction to CSS Grid
Kara Luton
 
The Future State of Layout
Stephen Hay
 
Laying out the future with grid & flexbox - Smashing Conf Freiburg
Rachel Andrew
 
17523630.ppt
ssusere2bc36
 
Evergreen websites for Evergreen browsers
Rachel Andrew
 
Full Stack Development CSS_Layouts,Grid,FlexboxPPT.pptx
ganeshchettipalli
 
The Future of CSS Layout
Zoe Gillenwater
 
2D Page Layout
Unfold UI
 
CSS Flexbox and Grid: The future of website layouts - DN Scrum Breakfast - Au...
Scrum Breakfast Vietnam
 
DevFest Nantes - Start Using CSS Grid Layout today
Rachel Andrew
 
Solving Layout Problems with CSS Grid & Friends - DevFest17
Rachel Andrew
 
Introduction to CSS Grid
Kara Luton
 
What I discovered about layout vis CSS Grid
Rachel Andrew
 
View Source London: Solving Layout Problems with CSS Grid & Friends
Rachel Andrew
 
Start Using CSS Grid Layout Today - RuhrJS
Rachel Andrew
 
Ad

Recently uploaded (20)

PDF
LLM Search Readiness Audit - Dentsu x SEO Square - June 2025.pdf
Nick Samuel
 
PPTX
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
PDF
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
PDF
Python Conference Singapore - 19 Jun 2025
ninefyi
 
PDF
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
DOCX
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
PPTX
Curietech AI in action - Accelerate MuleSoft development
shyamraj55
 
PDF
Open Source Milvus Vector Database v 2.6
Zilliz
 
PDF
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
PDF
My Journey from CAD to BIM: A True Underdog Story
Safe Software
 
PDF
Why aren't you using FME Flow's CPU Time?
Safe Software
 
PDF
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
PDF
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
PDF
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
PPSX
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
PDF
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
PPTX
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
PDF
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
PPTX
Practical Applications of AI in Local Government
OnBoard
 
LLM Search Readiness Audit - Dentsu x SEO Square - June 2025.pdf
Nick Samuel
 
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
Python Conference Singapore - 19 Jun 2025
ninefyi
 
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
Curietech AI in action - Accelerate MuleSoft development
shyamraj55
 
Open Source Milvus Vector Database v 2.6
Zilliz
 
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
My Journey from CAD to BIM: A True Underdog Story
Safe Software
 
Why aren't you using FME Flow's CPU Time?
Safe Software
 
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
Practical Applications of AI in Local Government
OnBoard
 

Grids of Tomorrow: CSS Grid Layout

  • 1. SIMONE LELLI UI Designer & Developer @ Objectway
  • 2. I like drawing, coding and cooking… ...COOKING?
  • 3. YES! WE'RE GOING TO COOK AMAZING LAYOUTS!
  • 4. CSS GRID: WHY I'M ENTHUSIAST I was a graphic designer converted to web. I love UI design and development. CREATIVITY VS "FORCED" LAYOUT SOLUTIONS -.-
  • 5. Tables Inline blocks Floats Flexbox They are all hacks like this: it looks like an hamburger... but it is a veggie-burger...
  • 6. ...IF YOU WANT A REAL BURGER...
  • 7. ...YOU HAVE TO TAKE A STEP TO THE FUTURE!
  • 9. WHY SHOULD I LEARN IT TODAY?
  • 11. TO DRIVE YOUR TEAM TOMORROW!
  • 12. WHAT IS IT CSS GRID LAYOUT MODULE? Two-dimensional grid layout system You can use media queries You can order child elements as you want
  • 13. HOW CAN I TRY IT NOW? CHROME chrome://flags/#enable-experimental-web-platform- features FIREFOX set true layout.css.grid.enabled inside about:config IE 10-11, EDGE -ms- prefix early implementation (with some differences)
  • 15. GRID LINES They can be referred to by numbers or they can be named.
  • 16. GRID TRACK The space between two tracks (horizontal or vertical)
  • 17. GRID CELL The smallest unit of the grid (space between four tracks). It's something like a table cell.
  • 18. GRID AREA Any area bounded by four lines: it may contain different grid cells.
  • 19. GRID GUTTERS Useful for cases with regular gutter sizes.
  • 20. DEFINE THE GRID A grid is defined by a new value of display property: display: grid
  • 21. HTML Define a container with 6 child elements <div class="grid-wrapper"> <div class="item a">A</div> <div class="item b">B</div> <div class="item c">C</div> <div class="item d">D</div> <div class="item e">E</div> <div class="item f">F</div> </div>
  • 22. CSS Defines a grid of 5 columns and 3 rows with different size .grid-wrapper { display: grid; grid-template-columns: 30% 5% 30% 5% 30%; grid-template-rows: 200px 20px 200px; }
  • 23. A B C D E F Auto-placement: each item fill the first available cell but we don't want items inside gutter columns.
  • 24. HOW TO PUT EACH ITEM IN THE RIGHT PLACE .a { grid-column-start: 1; grid-column-end: 2; grid-row-start: 1; grid-row-end: 2; } /* SHORTHAND */ .a { grid-column: 1/2; grid-row: 1/2; }
  • 25. A B C D E F Now each item is placed in the right place.
  • 26. A grid area can span as many cells you want… A B C D
  • 27. A B C D …in all directions and position…
  • 28. A BC D E Place items where you want! No order problems or limitations :)
  • 29. GRID GUTTERS A B C D .table { grid-row-gap: 20px; grid-column-gap: 20px; } /* Shorthand: row, column */ .table { grid-gap: 20px 20px; }
  • 30. SOMETHING MORE... You can span a grid area trough cells by lines numbers or with span keyword: with span you can say "start at line 1 and span 4 lines". .item { grid-column: 1 / span 4; } /* IS THE SAME OF */ .item { grid-column: 1 / 5; }
  • 31. NAMED LINES .grid-wrapper { display: grid; grid-template-columns: [col1-start] 200px [col1-end] 15px [col2-start grid-template-rows: [row1-start] 200px [row1-end] 15px [row2-start] }
  • 32. POSITIONING ITEMS USING NAMED LINES .item.a { display: grid; grid-column: col1-start / col1-end; grid-row: row1-start / row1-end; }
  • 34. Define named areas: each item is assoaciated to a named area .header {grid-area: header;} .content {grid-area: content;} .sidebar-a {grid-area: sidebar-a;} .sidebar-b {grid-area: sidebar-b;} .footer {grid-area: footer;}
  • 35. Define grid and place named areas something like ASCII-art! .grid-wrapper { display: grid; grid-template-columns: 30% 5% 30% 5% 30%; grid-template-rows: 200px 20px 200px; grid-template-areas: "header header header header header" ". . . . ." "sidebar-a . content . sidebar-b" ". . . . ." "footer footer footer footer footer" }
  • 36. FUNNY CODE, PERFECT RESULT Header Content Primary sidebar Secondary sidebar Footer
  • 37. VERY EASY TO CHANGE! Header Content Primary sidebar Secondary sidebar Footer
  • 38. .grid-wrapper.change { grid-template-areas: "sidebar-a . content content content" ". . . . ." "sidebar-b sidebar-b sidebar-b . footer" ". . . . ." "header header header header header" }
  • 40. EASY REPEAT A COLUMN/ROW PATTERN AS MANY TIMES YOU WANT! .grid-wrapper { display: grid; grid-template-columns: repeat(12, [gutter] 10px [col] 1fr); grid-template-row: repeat(24, [gutter] 10px [row] 80px); }
  • 41. THE "FR" UNIT The fr unit (fraction of available space) can be used for grid- rows and grid-columns values. It works as percentages for available space when fixed-sized and content-based columns/rows have taken their space.
  • 42. Bye bye Bootstrap, bye bye Foundation...
  • 43. ONE MORE FUNNY THING… OVERLAP
  • 44. A B C D F G E control overlaps with z-index
  • 45. NEXT STEP: NESTED GRIDS Header SUB-GRID SUB-GRID CONTENT SUB-GRID FOOTER SUB-GRID SIDEBAR Primary sidebar Secondary sidebar Footer Outer grid contains another grid defined by display: grid property. Nested grid is independent by parent.
  • 46. Nested grids can't inherit column widths from the parent. . . . grid: subgrid can do it but actually is not supported by browsers. Subgird feature is at-risk and may be dropped during the CR period.
  • 47. RESPONSIVE DESIGN CSS grids can be fully managed inside media queries: you have great control and unbelievable possibilities for web layouts. Redefine elements position and size is very easy. If you want you could also redefine your grid.
  • 50. CSS GRID LAYOUT + FLEXBOX
  • 51. Grid is the best for complex page layouts Grid is two-dimensional and supports non-linear design Flexbox is the ideal solution for small page components Flexbox is one-dimensional and supports linear design; remember that it works on axis (column and row direction).
  • 52. CSS Grid avoids redundant markup!
  • 53. A WELL-BALANCED MIX OF GRID AND FLEX IS THE KEY OF BETTER PERFORMANCE.
  • 54. THAT'S COOL, BUT IN REALITY?
  • 55. CHROME has the most advanced implementation (Blink). SAFARI is close to Chrome implementation, prefixed -webkit on nightlies. FIREFOX is in development. IE10+ & EDGE have a working but outdated implementation. The update to current spec is high priority in backlog.
  • 56. STATE OF THE SPECIFICATION Currently Working Dra Level 1: 17 September 2015 Plans to move it forward to Last Call Working Dra before CR.
  • 57. USEFUL LINKS W3C Working Dra https://www.w3.org/TR/css-grid-1 W3C Editor's Dra https://dra s.csswg.org/css-grid-1 Polyfill (by Fremy Company) https://github.com/FremyCompany/css-grid-polyfill Codepen examples: , ,1 2 3
  • 58. ENJOY IT! Thank you ;) Characters in GIFs are of the respective owners. I'm sorry if I broke some copyright but it wasn't for commercial purposes.