Last active
August 29, 2015 14:11
-
-
Save moreguppy/a7ce880b31044e5513fd to your computer and use it in GitHub Desktop.
Using flexbox for centered floaty layouts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Notes: | |
- Using bourbon.io | |
- Currently only supported down to IE10 :( | |
- This was helpful <http://jonibologna.com/flexbox-cheatsheet/> | |
- Bourbon flex docs <http://bourbon.io/docs/#flexbox> | |
*/ | |
.flex--container { | |
@include display(flex); | |
@include flex-direction(row); | |
@include justify-content(space-around); | |
@include align-items(center); | |
.flex--child { | |
@include flex(1); | |
} | |
.flex--teen { | |
@include flex(3) | |
} | |
} | |
/* | |
Example markup: | |
--------------------------------- | |
<div class="flex--container"> | |
<div class="flex--child"> | |
:) | |
</div> | |
<div class="flex--teex"> | |
;) | |
</div> | |
<div class="flex--child"> | |
:o | |
</div> | |
</div> | |
Example layout: | |
------------------------------------ | |
| | | |
:) | ;) | :o | |
| | | |
------------------------------------ | |
*/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment