Skip to content

Instantly share code, notes, and snippets.

@hadynz
Created May 15, 2015 02:29
Show Gist options
  • Save hadynz/bd09120f7c1d6b56eb38 to your computer and use it in GitHub Desktop.
Save hadynz/bd09120f7c1d6b56eb38 to your computer and use it in GitHub Desktop.
Flexbox grid component - inspired by Shopify
.flex-grid {
display: flex;
box-sizing: border-box;
padding-top: 10px;
width: calc(100% - 20px);
margin: 0 auto;
}
.flex-grid:last-of-type {
padding-bottom: 10px;
}
.flex-grid--no-padding, .flex-grid--no-padding:last-of-type {
padding: 0;
}
.flex-grid--right-aligned {
-webkit-box-pack: end;
-webkit-justify-content: flex-end;
-ms-flex-pack: end;
justify-content: flex-end;
}
.flex-grid__cell {
box-sizing: border-box;
max-width: 100%;
min-width: 0;
flex: 1 1 0%;
padding: 10px;
}
.flex-grid__cell--no-flex {
flex: 0 0 auto;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment