Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Flexbox

 Flexbox

CSS + Layout + Fun are three words you don't see together often. CSS has given us a raw deal when it comes to tools for building complex UIs, resulting in us resorting to all manner of hacks over the years. With the advent of Flexbox and the fact it has support across all "Evergreen" browsers, things are looking up. This talk will go into the features of Flexbox and how it makes building complex UIs easier.

Presented at DublinJS http://www.meetup.com/DublinJS/events/222570156/

Pat O'Callaghan

March 01, 2016
Tweet

More Decks by Pat O'Callaghan

Other Decks in Programming

Transcript

  1. Axes Main Axis Cross Axis 1 2 3 .flex-container {

    display: flex; flex-direction: row; }
  2. Direction Main Axis 1 2 3 Cross Axis .flex-container {

    display: flex; flex-direction: row-reverse; }
  3. Direction Main Axis 1 2 3 Cross Axis .flex-container {

    display: flex; flex-direction: column; }
  4. Direction Main Axis 1 2 3 Cross Axis .flex-container {

    display: flex; flex-direction: column-reverse; } 1
  5. Equal Height Columns * Two approaches we previously had to

    do were: * “faux columns” * Javascript
  6. Source Ordering • Responsive layouts can require moving content around

    at different screen sizes • Duplicate content and show/hide it per viewport • Use JavaScript to copy the content around the source • Flexbox order + media queries • Content Choreography demo
  7. Wrapping Up • Flexbox is ready for primetime now, get

    using it! • Its concepts may seem abstract and difficult at first • Allows you create complex layouts easily • No more hacks! • Lots of amazing resources out there today
  8. References • Centering in the Unknown • Fighting the Space

    Between Inline Block Elements • GSS (Grid StyleSheets) • W3C Flexbox Spec • What the Flexbox?! • Flexbox Froggy • CSS Trick’s A Complete Guide to Flexbox • Flexbox Cheatsheet • Solved by Flexbox • Grid, Flexbox, Box Alignment: Our New System for Layout • Building For Content Choreography Using Flexbox • caniuse Flexbox • Flexibility: Old IE Flexbox polyfill