Skip to content

Instantly share code, notes, and snippets.

@ademilter
Last active August 29, 2015 14:03
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 ademilter/024c544938b89c6280e4 to your computer and use it in GitHub Desktop.
Save ademilter/024c544938b89c6280e4 to your computer and use it in GitHub Desktop.
_grid.scss
$width-Container: 1200px;
$gutter-Row: 15px;
.Container {
max-width: $width-Container + $gutter-Row * 2;
margin-right: auto;
margin-left: auto;
padding-right: $gutter-Row;
padding-left: $gutter-Row;
}
.Row {
display: block;
font-size: 0;
text-align: left;
&#{--center} {
text-align: center;
}
&#{--right} {
text-align: right;
}
&#{--widthGutter} {
margin-right: -$gutter-Row;
margin-left: -$gutter-Row;
}
}
.Cell {
display: inline-block;
font-size: 1rem;
text-align: left;
width: 100%;
vertical-align: top;
.Row--widthGutter & {
padding-right: $gutter-Row;
padding-left: $gutter-Row;
}
&#{--Center} {
display: block;
margin-left: auto;
margin-right: auto;
}
}
@for $i from 1 through 12 {
@for $j from 1 through 12 {
@if $i < $j {
.u-#{$i}of#{$j} {
width: 100% * $i / $j !important;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment