Skip to content

Instantly share code, notes, and snippets.

@hostsamurai
Created October 14, 2010 03:42
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 hostsamurai/625527 to your computer and use it in GitHub Desktop.
Save hostsamurai/625527 to your computer and use it in GitHub Desktop.
// Sass (SCSS) version of the Simpler CSS Grid system
// http://www.webdesignerwall.com/tutorials/the-simpler-css-grid/
$grid-width: 978px;
$column-width: 54px;
$column-gutter: 30px;
.grid-col {
float: left;
display: inline;
margin-left: $column-gutter;
}
.container {
width: $grid-width;
margin: 0 auto;
// set up .grid1 through .grid11
@for $i from 1 through 11 {
.grid#{$i} {
@extend .grid-col;
}
@if $i == 1 {
.grid#{$i} { width: $column-width; }
} @else {
.grid#{$i} { width: ($column-width * $i) + ($column-gutter * ($i - 1)); }
}
}
.grid12 {
@extend .grid-col;
margin-left: 0;
clear: right;
}
.first {
margin-left: 0;
clear: left;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment