Skip to content

Instantly share code, notes, and snippets.

@cjbell
Created December 11, 2013 15:13
Show Gist options
  • Save cjbell/7912092 to your computer and use it in GitHub Desktop.
Save cjbell/7912092 to your computer and use it in GitHub Desktop.
Simple grid functions
@function grid-calc($n, $g: 12) {
@return ($n / $g) * 100%;
}
// 12 column grid
@for $i from 1 through 12 {
%grid-#{$i}-of-12 { width: grid-calc($i); }
}
// Usage <div class="grid-3-of-12"></div>
// Or @extend .grid-3-of-12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment