Created
October 31, 2013 05:57
-
-
Save patelprashant/7244887 to your computer and use it in GitHub Desktop.
SASS - Grid generator
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
| // Custom Grid System | |
| $grid_width : 960px; | |
| $grid_col : 12; | |
| $grid_gut : 20px; | |
| body { min-width: $grid_width; } | |
| .container_#{$grid_col} { margin-left: auto; margin-right: auto; width: $grid_width; | |
| @for $i from 1 through $grid_col { | |
| .grid_#{$i} { display: inline; float: left; margin-left: $grid_gut / 2; margin-right: $grid_gut / 2; } | |
| .push_#{$i}, .pull_#{$i} { position: relative; } | |
| .grid_#{$i} { width: ( ($grid_width / $grid_col - $grid_gut) * $i ) + (($i - 1) * $grid_gut); } | |
| .prefix_#{$i} { padding-left: $grid_width / $grid_col * $i ; } | |
| .suffix_#{$i} { padding-right: $grid_width / $grid_col * $i ; } | |
| .push_#{$i} { left: $grid_width / $grid_col * $i ; } | |
| .pull_#{$i} { right: $grid_width / $grid_col * $i ; } | |
| } | |
| .alpha { margin-left: 0; } // no left margin | |
| .omega { margin-right: 0; } // no right margin | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment