Skip to content

Instantly share code, notes, and snippets.

@chaddy81
Created January 28, 2016 19:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chaddy81/f852004d6d1510eec1f6 to your computer and use it in GitHub Desktop.
Save chaddy81/f852004d6d1510eec1f6 to your computer and use it in GitHub Desktop.
SCSS Grid
$columns: 12 !default;
$gutter: 30px !default;
$max-width: 1170px;
.grid {
margin: 0px auto;
max-width: $max-width;
width: 100%;
}
.grid__row {
margin-left: -$gutter/2;
margin-right: -$gutter/2;
width: 100%;
@extend .clearfix;
}
@for $i from 1 through $columns {
.grid__unit--#{$i} {
float: left;
min-height: 1px;
padding: 0 $gutter/2;
position: relative;
width: percentage( $i / $columns );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment