SlideShare a Scribd company logo
1 of 24
Download to read offline
Ridiculously
E
A
S
Y
Layouts
with
Flexbox
https://github.com/ecarlisle/Easy-Layouts-with-Flexbox
@eric_carlisleEric Carlisle
me, myself, and i
Eric Carlisle
UI / UX Geek
Baltimore, MD
who?
what?
where?
how?
what the flex is a flexbox?
A CSS layout mode.
what the flex is a flexbox?
A CSS layout mode.
/* Instead of block, inline, table, etc… */
.something {
display: flex;
}
what the flex is a flexbox?
A CSS layout mode.
/* Instead of block, inline, table, etc… */
.something {
display: flex;
}
Flexible space allocation relationships between
parent & child elements.
what the flex is a flexbox?
A CSS layout mode.
/* Instead of block, inline, table, etc… */
.something {
display: flex;
}
Flexible space allocation relationships between
parent & child elements.
Multi-axis – elements stack horizontally or
vertically! Let’s see that, shall we?
what the flex is a flexbox?
Core Concepts: §  There is always a main & cross axis.
§  Each have a start, end, and size.
§  Axis direction depends on flex-direction property.
general benefits?
§  W3C Standard! No libraries needed!
§  Once you grok it, it’s amazingly easy.
§  Opportunity for tremendous creativity.
layout benefits?
§  Gets us away from countless floats and clears!
§  Override source order with CSS!
§  Vertical positioning without hacks!
§  Equal heights (e.g. columns)
layout-benefits?
§  Elements “flex” to fit available space.
§  Custom responsive layouts can be a cakewalk!
§  More opportunity for the semantic.
final results?
PURE AWESOMENESS!
what’s the rub?
There’s been some history.
/* 2009 initial version */
display: box;
/* 2011-12 “tweener” version */
display: flexbox;
/* Present day */
display: flex;
what’s the rub?
/* Webkit */
display: "-webkit-flex”;
/* Mozilla */
display: "-moz-flex;
/* IE10 */
display: "-ms-flexbox";
/* IE11 */
display: "-ms-flex”;
/* W3C */
display: “flex”
“Holy Browser Prefixes, Batman!”
what’s the rub?
/* Webkit */
display: "-webkit-flex”;
/* Mozilla */
display: "-moz-flex;
/* IE10 */
display: "-ms-flexbox";
/* IE11 */
display: "-ms-flex”;
/* W3C */
display: “flex”
“Holy Browser Prefixes, Batman!”
Recommended Approach:
Use Preprocessor Mixins!
(For this presentation, I’ll use FireFox Developer Edition)
what’s the rub?
It works in everything except…
Guess!
what’s the rub?
It works in everything except…
“The browser that must not be named.”
what’s the rub?
h"p://caniuse.com/#feat=flexbox	
  
§  Clear-ish support across the board
§  IE10 supports the 2012 version (as per current spec)
§  Most current browsers still have flexbox “personality”
But in All Fairness…
what’s the rub?
OK, not so bad, right?
“See, I’m not such a bad guy after all!”
what’s the rub?
It’s not exactly done done done yet.
h"p://dev.w3.org/csswg/css-­‐flexbox/	
  
Editor’s	
  DraB	
  –	
  March	
  2nd,	
  2015	
  
h"p://www.w3.org/TR/css3-­‐flexbox/	
  
Last	
  Call	
  Working	
  DraB	
  –	
  September	
  25th	
  2014	
  
what’s the rub?
It’s not exactly done done done yet.
h"p://dev.w3.org/csswg/css-­‐flexbox/	
  
Editor’s	
  DraB	
  –	
  March	
  2nd,	
  2015	
  
h"p://www.w3.org/TR/css3-­‐flexbox/	
  
Last	
  Call	
  Working	
  DraB	
  –	
  September	
  25th	
  2014	
  
“Standards	
  are	
  Paper.”	
  
-­‐-­‐	
  Linus	
  Torvalds	
  
Parents & Children
Parent Properties
display:
flex-direction:
flex-wrap:
Justify-content:
Align-items:
Align-content:
Flex or flex-inline?
Row? Column? Which way?
Line break? Which way?
Space allocation of the stretch?
Alignment on main axis?
Align wrapped content on the cross axis?
Child Properties
order:
flex-grow:
flex-shrink:
flex-basis:
align-self:
Source order or something else?
Remaining space allocation on growth?
Remaining space allocation on shrink?
What is the “remaining” space?
Do I really want to align that way?
Q/A
Eric Carlisle
@eric_carlisle
eric@ericcarlisle.com

More Related Content

What's hot

What's hot (20)

Using Flexbox Today (CSS Summit 2016)
Using Flexbox Today (CSS Summit 2016)Using Flexbox Today (CSS Summit 2016)
Using Flexbox Today (CSS Summit 2016)
 
Understanding flexbox
Understanding flexboxUnderstanding flexbox
Understanding flexbox
 
Using Flexbox Today (Frontend United 2016)
Using Flexbox Today (Frontend United 2016)Using Flexbox Today (Frontend United 2016)
Using Flexbox Today (Frontend United 2016)
 
Layout with flexbox
Layout with flexboxLayout with flexbox
Layout with flexbox
 
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
 
Enhancing Responsiveness With Flexbox (CSS Day)
Enhancing Responsiveness With Flexbox (CSS Day)Enhancing Responsiveness With Flexbox (CSS Day)
Enhancing Responsiveness With Flexbox (CSS Day)
 
Enhancing Responsiveness with Flexbox (RWD Summit)
Enhancing Responsiveness with Flexbox (RWD Summit)Enhancing Responsiveness with Flexbox (RWD Summit)
Enhancing Responsiveness with Flexbox (RWD Summit)
 
Enhancing Responsiveness with Flexbox (CSS Conf EU 2015)
Enhancing Responsiveness with Flexbox (CSS Conf EU 2015)Enhancing Responsiveness with Flexbox (CSS Conf EU 2015)
Enhancing Responsiveness with Flexbox (CSS Conf EU 2015)
 
Enhancing Responsiveness With Flexbox (Smashing Conference)
Enhancing Responsiveness With Flexbox (Smashing Conference)Enhancing Responsiveness With Flexbox (Smashing Conference)
Enhancing Responsiveness With Flexbox (Smashing Conference)
 
CSS3 Layout
CSS3 LayoutCSS3 Layout
CSS3 Layout
 
Using Flexbox Today (Generate Sydney 2016)
Using Flexbox Today (Generate Sydney 2016)Using Flexbox Today (Generate Sydney 2016)
Using Flexbox Today (Generate Sydney 2016)
 
Responsive Flexbox Inspiration (Responsive Day Out)
Responsive Flexbox Inspiration (Responsive Day Out)Responsive Flexbox Inspiration (Responsive Day Out)
Responsive Flexbox Inspiration (Responsive Day Out)
 
Flexbox: One Giant Leap for Web Layout (Breaking Development 2013)
Flexbox: One Giant Leap for Web Layout (Breaking Development 2013)Flexbox: One Giant Leap for Web Layout (Breaking Development 2013)
Flexbox: One Giant Leap for Web Layout (Breaking Development 2013)
 
Flexbox Will Shock You!
Flexbox Will Shock You!Flexbox Will Shock You!
Flexbox Will Shock You!
 
Brownbag on basics of web components
Brownbag on basics of web componentsBrownbag on basics of web components
Brownbag on basics of web components
 
Designing True Cross-Platform Apps
Designing True Cross-Platform AppsDesigning True Cross-Platform Apps
Designing True Cross-Platform Apps
 
Getting started with flexbox
Getting started with flexboxGetting started with flexbox
Getting started with flexbox
 
Is Flexbox the Future of Layout?
Is Flexbox the Future of Layout?Is Flexbox the Future of Layout?
Is Flexbox the Future of Layout?
 
Things To Keep In Mind When Working In The World Of Responsive Design
Things To Keep In Mind When Working In The World Of Responsive DesignThings To Keep In Mind When Working In The World Of Responsive Design
Things To Keep In Mind When Working In The World Of Responsive Design
 
Floating
FloatingFloating
Floating
 

Viewers also liked

HOJA DE VIDA EN INGLÈS
HOJA DE VIDA EN INGLÈSHOJA DE VIDA EN INGLÈS
HOJA DE VIDA EN INGLÈS
aquilioayola
 
OEE River Guide Training Checklist_2015
OEE River Guide Training Checklist_2015OEE River Guide Training Checklist_2015
OEE River Guide Training Checklist_2015
Colter Christensen
 
cuestionario de computación 6 de turismo
cuestionario de computación 6 de turismocuestionario de computación 6 de turismo
cuestionario de computación 6 de turismo
veritopesantez
 
David Martin-Resume General Manager
David Martin-Resume General ManagerDavid Martin-Resume General Manager
David Martin-Resume General Manager
David Martin
 

Viewers also liked (17)

Art Portfolio
Art PortfolioArt Portfolio
Art Portfolio
 
Servo drive application for box labeling
Servo drive application for box labelingServo drive application for box labeling
Servo drive application for box labeling
 
Why people are wanting to gain permanent residency in australia
Why people are wanting to gain permanent residency in australiaWhy people are wanting to gain permanent residency in australia
Why people are wanting to gain permanent residency in australia
 
HOJA DE VIDA EN INGLÈS
HOJA DE VIDA EN INGLÈSHOJA DE VIDA EN INGLÈS
HOJA DE VIDA EN INGLÈS
 
OEE River Guide Training Checklist_2015
OEE River Guide Training Checklist_2015OEE River Guide Training Checklist_2015
OEE River Guide Training Checklist_2015
 
5º Básico A: Informativo Nº 29: Semana del 03 al 07 de octubre
5º Básico A: Informativo Nº 29: Semana del 03 al 07 de octubre5º Básico A: Informativo Nº 29: Semana del 03 al 07 de octubre
5º Básico A: Informativo Nº 29: Semana del 03 al 07 de octubre
 
MozCon - Mobilegeddon
MozCon - MobilegeddonMozCon - Mobilegeddon
MozCon - Mobilegeddon
 
2016 Guide to User Data Security
2016 Guide to User Data Security2016 Guide to User Data Security
2016 Guide to User Data Security
 
cuestionario de computación 6 de turismo
cuestionario de computación 6 de turismocuestionario de computación 6 de turismo
cuestionario de computación 6 de turismo
 
Virtualus mobilumas aukštojo mokslo studijoms
Virtualus mobilumas aukštojo mokslo studijomsVirtualus mobilumas aukštojo mokslo studijoms
Virtualus mobilumas aukštojo mokslo studijoms
 
Leveraging LinkedIn - Creating a Professional Brand That People will Remember
Leveraging LinkedIn - Creating a Professional Brand That People will RememberLeveraging LinkedIn - Creating a Professional Brand That People will Remember
Leveraging LinkedIn - Creating a Professional Brand That People will Remember
 
Pensioenkas Brussels parlement heeft tekort van 37,5 miljoen
Pensioenkas Brussels parlement heeft tekort van 37,5 miljoenPensioenkas Brussels parlement heeft tekort van 37,5 miljoen
Pensioenkas Brussels parlement heeft tekort van 37,5 miljoen
 
Keene Dumpsters
Keene DumpstersKeene Dumpsters
Keene Dumpsters
 
Atrapados en las redes caught in networks
Atrapados en las redes caught in networksAtrapados en las redes caught in networks
Atrapados en las redes caught in networks
 
David Martin-Resume General Manager
David Martin-Resume General ManagerDavid Martin-Resume General Manager
David Martin-Resume General Manager
 
El modelo educativo_2016
El modelo educativo_2016El modelo educativo_2016
El modelo educativo_2016
 
Restaurant Digital Menu
Restaurant Digital MenuRestaurant Digital Menu
Restaurant Digital Menu
 

Similar to Ridiculously Easy Layouts with Flexbox

CodeFest 2014. Пухальский И. — Отзывчивые кроссплатформенные веб-приложения
CodeFest 2014. Пухальский И. — Отзывчивые кроссплатформенные веб-приложенияCodeFest 2014. Пухальский И. — Отзывчивые кроссплатформенные веб-приложения
CodeFest 2014. Пухальский И. — Отзывчивые кроссплатформенные веб-приложения
CodeFest
 

Similar to Ridiculously Easy Layouts with Flexbox (20)

Understanding flexbox
Understanding flexboxUnderstanding flexbox
Understanding flexbox
 
Angels versus demons: balancing shiny and inclusive
Angels versus demons: balancing shiny and inclusiveAngels versus demons: balancing shiny and inclusive
Angels versus demons: balancing shiny and inclusive
 
CodeFest 2014. Пухальский И. — Отзывчивые кроссплатформенные веб-приложения
CodeFest 2014. Пухальский И. — Отзывчивые кроссплатформенные веб-приложенияCodeFest 2014. Пухальский И. — Отзывчивые кроссплатформенные веб-приложения
CodeFest 2014. Пухальский И. — Отзывчивые кроссплатформенные веб-приложения
 
Why you should consider Flexbox for your next project
Why you should consider Flexbox for your next projectWhy you should consider Flexbox for your next project
Why you should consider Flexbox for your next project
 
CSS Flexbox (flexible box layout)
CSS Flexbox (flexible box layout)CSS Flexbox (flexible box layout)
CSS Flexbox (flexible box layout)
 
Start with Bolt and Go Ez - eZ Publish Summer Camp 2015
Start with Bolt and Go Ez - eZ Publish Summer Camp 2015Start with Bolt and Go Ez - eZ Publish Summer Camp 2015
Start with Bolt and Go Ez - eZ Publish Summer Camp 2015
 
CSS flexbox
CSS flexboxCSS flexbox
CSS flexbox
 
#2 - CSS Layouts Overview
#2 - CSS Layouts Overview#2 - CSS Layouts Overview
#2 - CSS Layouts Overview
 
Flexbox
FlexboxFlexbox
Flexbox
 
From Hacker to Programmer (w/ Webpack, Babel and React)
From Hacker to Programmer (w/ Webpack, Babel and React)From Hacker to Programmer (w/ Webpack, Babel and React)
From Hacker to Programmer (w/ Webpack, Babel and React)
 
Show & tell - Flex in flux
Show & tell - Flex in fluxShow & tell - Flex in flux
Show & tell - Flex in flux
 
Go With The Reflow
Go With The ReflowGo With The Reflow
Go With The Reflow
 
Introducing coServ
Introducing coServIntroducing coServ
Introducing coServ
 
Worry free web development
Worry free web developmentWorry free web development
Worry free web development
 
Is Flexbox the Future of Layout -bdconf
Is Flexbox the Future of Layout -bdconfIs Flexbox the Future of Layout -bdconf
Is Flexbox the Future of Layout -bdconf
 
Plone Futures, Plone Conference 2016 Keynote by Eric Steele
Plone Futures, Plone Conference 2016 Keynote by Eric SteelePlone Futures, Plone Conference 2016 Keynote by Eric Steele
Plone Futures, Plone Conference 2016 Keynote by Eric Steele
 
Plone Futures
Plone FuturesPlone Futures
Plone Futures
 
Java EE 7 from an HTML5 Perspective, JavaLand 2015
Java EE 7 from an HTML5 Perspective, JavaLand 2015Java EE 7 from an HTML5 Perspective, JavaLand 2015
Java EE 7 from an HTML5 Perspective, JavaLand 2015
 
Look ma! No images!
Look ma! No images!Look ma! No images!
Look ma! No images!
 
Building great mobile apps: Somethings you might want to know
Building great mobile apps: Somethings you might want to knowBuilding great mobile apps: Somethings you might want to know
Building great mobile apps: Somethings you might want to know
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

Ridiculously Easy Layouts with Flexbox