Created
December 11, 2013 15:13
-
-
Save cjbell/7912092 to your computer and use it in GitHub Desktop.
Simple grid functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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