Slide 1

Slide 1 text

Mike Aparicio User Interface Engineer, Groupon
 maparicio@groupon.com @peruvianidol Fun with Flexbox

Slide 2

Slide 2 text

Table Layout

Slide 3

Slide 3 text

CSS Layout

Slide 4

Slide 4 text

float: left; float: right; clear: both; display: block; margin: 0 auto; position: relative; .clearfix WTF overflow: auto;

Slide 5

Slide 5 text

Flexbox The Flexbox Layout (Flexible Box) module (currently a W3C Candidate Recommendation) aims at providing a more efficient way to lay out, align and distribute space among items in a container, even when their size is unknown and/or dynamic (thus the word "flex"). http://css-tricks.com/snippets/css/a-guide-to-flexbox/

Slide 6

Slide 6 text

display: block

Slide 7

Slide 7 text

Flex Container

Slide 8

Slide 8 text

Gives direct child elements flex context display: flex

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

Determines direction of flex axis and order of items along the main axis flex-direction

Slide 12

Slide 12 text

Reverses main axis and cross axis flex-direction

Slide 13

Slide 13 text

Reverses order and alignment while maintaining source order flex-direction

Slide 14

Slide 14 text

Determines whether flex items should fit onto a single row or wrap onto multiple rows flex-wrap

Slide 15

Slide 15 text

flex-wrap

Slide 16

Slide 16 text

Reverses direction of wrapping along the cross axis flex-wrap

Slide 17

Slide 17 text

Combines flex-direction and flex-wrap properties flex-flow

Slide 18

Slide 18 text

Determines alignment of flex items across the main axis justify-content

Slide 19

Slide 19 text

justify-content

Slide 20

Slide 20 text

align-items Determines alignment of flex items across the cross axis when flex container is taller than content

Slide 21

Slide 21 text

align-items

Slide 22

Slide 22 text

align-items Aligns flex items with different font sizes along their baseline

Slide 23

Slide 23 text

align-content Determines alignment of multiple rows when their height exceeds the height of the flex items

Slide 24

Slide 24 text

align-content

Slide 25

Slide 25 text

align-content

Slide 26

Slide 26 text

align-content

Slide 27

Slide 27 text

align-content

Slide 28

Slide 28 text

align-content

Slide 29

Slide 29 text

Flex Items

Slide 30

Slide 30 text

flex-grow Enables flex items to grow to fill available space

Slide 31

Slide 31 text

flex-grow

Slide 32

Slide 32 text

flex-grow

Slide 33

Slide 33 text

flex-grow

Slide 34

Slide 34 text

flex-shrink Enables flex items to shrink when they exceed the size of the flex container

Slide 35

Slide 35 text

flex-shrink

Slide 36

Slide 36 text

flex-basis Sets a default width for flex items before extra space is distributed

Slide 37

Slide 37 text

flex-basis

Slide 38

Slide 38 text

flex-basis

Slide 39

Slide 39 text

flex-basis

Slide 40

Slide 40 text

flex Combines flex-grow, flex-shrink and flex-basis properties

Slide 41

Slide 41 text

order Sets display order of flex items

Slide 42

Slide 42 text

order

Slide 43

Slide 43 text

align-self Overrides align-items property of flex container for individual flex items

Slide 44

Slide 44 text

align-self

Slide 45

Slide 45 text

Use Cases

Slide 46

Slide 46 text

Navigation

Slide 47

Slide 47 text

Navigation

Slide 48

Slide 48 text

Responsive Grid

Slide 49

Slide 49 text

Responsive Grid

Slide 50

Slide 50 text

Responsive Grid

Slide 51

Slide 51 text

Flex-Figure

Slide 52

Slide 52 text

Flex-Figure

Slide 53

Slide 53 text

Flex Forms

Slide 54

Slide 54 text

Vertical Centering

Slide 55

Slide 55 text

Sticky Footer

Slide 56

Slide 56 text

Responsive “Holy Grail” Layout

Slide 57

Slide 57 text

Responsive “Holy Grail” Layout

Slide 58

Slide 58 text

Browser Support

Slide 59

Slide 59 text

No content

Slide 60

Slide 60 text

Resources

Slide 61

Slide 61 text

A Complete Guide to Flexbox
 http://css-tricks.com/snippets/css/a-guide-to-flexbox/ ! Solved by Flexbox
 http://philipwalton.github.io/solved-by-flexbox/ ! Flexbox in 5 Minutes
 http://devbryce.com/site/flexbox/ ! Flexplorer
 http://bennettfeely.com/flexplorer/ ! Flexy Boxes
 http://the-echoplex.net/flexyboxes/ Resources

Slide 62

Slide 62 text

Thank You!