Created
February 19, 2012 09:23
-
-
Save yvesvanbroekhoven/1862723 to your computer and use it in GitHub Desktop.
Sass semantic grid approach
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
| // Defaults which you can freely override | |
| $column-width: 60px; | |
| $gutter-width: 20px; | |
| $columns: 12; | |
| // Utility function — you should never need to modify this | |
| @function gridsystem-width($columns:$columns) { | |
| @return ($column-width * $columns) + ($gutter-width * $columns); | |
| } | |
| @mixin row($columns) { | |
| @include clearfix; | |
| display: block; | |
| width: gridsystem-width($columns); | |
| margin: 0 (($gutter-width * .5) * -1) | |
| } | |
| @mixin column($x) { | |
| display: inline; | |
| float: left; | |
| width: (($gutter-width + $column-width) * $x) - $gutter-width; | |
| margin: 0 ($gutter-width / 2); | |
| } | |
| @mixin offset($offset: 1) { | |
| margin-left: $offset * ($column-width + $gutter-width) + ($gutter-width / 2); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment