Skip to content

Instantly share code, notes, and snippets.

@davidpaulsson
Created June 2, 2015 13:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidpaulsson/33b463b01564883d6796 to your computer and use it in GitHub Desktop.
Save davidpaulsson/33b463b01564883d6796 to your computer and use it in GitHub Desktop.
flexbox grid
/*--------------------------------------------------------------
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