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

Why you should consider FLEXBOX for your next project

Why you should consider FLEXBOX for your next project

This is my presentation slides given at SAWEBDEV meet up on 7/19/2016. I briefly talk about what problems flexbox solves, when to use it and when not to use it, as well as look at each of the flexbox properties with examples.

Anton Domratchev

July 19, 2016
Tweet

Other Decks in Programming

Transcript

  1. ABOUT ME ▸ Anton Domratchev ▸ Software Developer at Grok

    Interactive ▸ PHP, Ruby ▸ HTML, SCSS, ES6, ReactJS antondomratchev @antondom
  2. WHAT IS FLEXBOX? The CSS3 Flexible Box, or flexbox, is

    a layout mode providing for the arrangement of elements on a page such that the elements behave predictably when the page layout must accommodate different screen sizes and different display devices. - Mozilla Developer Network
  3. WHEN SHOULD I NOT USE FLEXBOX? ▸ Don’t use flexbox

    for overall page layout* ▸ Don’t use flexbox on every container ▸ IE8 & IE9
  4. FLEXBOX PROPERTIES Container flex properties ‣ display: flex ‣ flex-direction:

    row/reverse, column/reverse ‣ flex-wrap: nowrap, wrap/reverse ‣ (axis) justify-content: flex-start, flex-end, center, space-between, space- around ‣ (axis) align-items: stretch, flex-start, flex-end, center, baseline ‣ (wrapped items) align-content: stretch, flex-start, flex-end, center, space- around, space-between
  5. FLEXBOX PROPERTIES Container item flex properties ‣ order: n ‣

    flex-grow: n ‣ flex-shrink: n ‣ flex-basis: n [px] ‣ flex: flex-grow n flex-shrink n flex-basis n [px] ‣ align-self: flex-start, flex-end, center, stretch
  6. TOOLS TO HELP YOU LEARN FLEXBOX MDN flexible box documentation


    Flexbox Froggy Ultimate Flexbox Cheat Sheet Sketching with CSS antondomratchev @antondom