Created
June 2, 2015 13:17
-
-
Save davidpaulsson/33b463b01564883d6796 to your computer and use it in GitHub Desktop.
flexbox grid
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
/*-------------------------------------------------------------- | |
Flexbox grid | |
--------------------------------------------------------------*/ | |
// Wrapper | |
.grid { | |
display: flex; | |
} | |
// Alignment per row | |
.grid--top { | |
align-items: flex-start; | |
} | |
.grid--bottom { | |
align-items: flex-end; | |
} | |
.grid--center { | |
align-items: center; | |
} | |
// Padding support | |
.grid--padding { | |
& > div { | |
margin-right: $size-gutter / 2; | |
margin-left: $size-gutter / 2; | |
&:first-child { | |
margin-left: 0; | |
} | |
&:last-child { | |
margin-right: 0; | |
} | |
} | |
} | |
// Induvidual cell | |
.grid__cell { | |
flex: 1; | |
} | |
// Alignment per cell | |
.grid__cell--top { | |
align-self: flex-start; | |
} | |
.grid__cell--bottom { | |
align-self: flex-end; | |
} | |
.grid__cell--center { | |
align-self: center; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment