Created
March 23, 2015 14:15
-
-
Save kaskajp/b4f91dd900004612fe56 to your computer and use it in GitHub Desktop.
SCSS Grid
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
$gridgutter: 30; | |
$gridpadding: 30; | |
$gridsize: 978 + ($gridpadding*2); | |
$gridcolsize: (($gridsize - ($gridgutter * 11)) / 12); | |
.grid { | |
width: 100%; | |
max-width: $gridsize+px; | |
margin: 0 auto; | |
padding-left: $gridpadding+px; | |
padding-right: $gridpadding+px; | |
&:after { | |
content: ""; | |
display: table; | |
clear: both; | |
} | |
[class*='col-'] { | |
float: left; | |
min-height: 1px; | |
margin-right: ((100%/$gridsize) * $gridgutter); | |
position: relative; | |
&:last-of-type { margin-right: 0; } | |
} | |
@for $i from 1 through 12 { | |
.col-#{$i} { | |
width: (100% / $gridsize) * ($gridcolsize*$i+($gridgutter*($i - 1))); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment