Skip to content

Instantly share code, notes, and snippets.

@dstaley
Created December 21, 2015 19:01
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 dstaley/119a3fe5e95445b8377e to your computer and use it in GitHub Desktop.
Save dstaley/119a3fe5e95445b8377e to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// libsass (v3.3.2)
// ----
@mixin generate-grid($col: 12) {
@for $i from 1 to $col + 1 {
.col-#{$i} { flex: 0 0 percentage($i/$col); }
}
}
$mobile-width: 48em;
.row {
display: flex;
@media (max-width: $mobile-width) {
flex-direction: column;
}
}
.col {
flex: 1;
@media (max-width: $mobile-width) {
flex: 0 0 auto;
}
}
@media (min-width: $mobile-width) {
@include generate-grid();
}
.row {
display: flex;
}
@media (max-width: 48em) {
.row {
flex-direction: column;
}
}
.col {
flex: 1;
}
@media (max-width: 48em) {
.col {
flex: 0 0 auto;
}
}
@media (min-width: 48em) {
.col-1 {
flex: 0 0 8.33333%;
}
.col-2 {
flex: 0 0 16.66667%;
}
.col-3 {
flex: 0 0 25%;
}
.col-4 {
flex: 0 0 33.33333%;
}
.col-5 {
flex: 0 0 41.66667%;
}
.col-6 {
flex: 0 0 50%;
}
.col-7 {
flex: 0 0 58.33333%;
}
.col-8 {
flex: 0 0 66.66667%;
}
.col-9 {
flex: 0 0 75%;
}
.col-10 {
flex: 0 0 83.33333%;
}
.col-11 {
flex: 0 0 91.66667%;
}
.col-12 {
flex: 0 0 100%;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment