Created
August 14, 2012 21:40
-
-
Save jlong/3353289 to your computer and use it in GitHub Desktop.
Grids
This file contains 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
// Grids | |
=grids($max-columns: 10) | |
#{enumerate(".grid", 2, $max-columns)} | |
+clearfix | |
@for $columns from 2 through $max-columns | |
.grid-#{$columns} | |
+grid($columns) | |
#{enumerate('.span', 1, $max-columns)} | |
> *:first-child | |
margin-top: 0 !important | |
#{enumerate('.grid', 2, $max-columns)} | |
.clear | |
clear: left | |
.right | |
text-align: right | |
float: right | |
.center | |
text-align: center | |
.last | |
margin-right: 0 !important | |
// A simple grid mixin | |
=grid($columns: 2) | |
$column-width: floor(1 / $columns * 100%) | |
+box-sizing(border-box) | |
#{enumerate('.span', 1, $columns)} | |
float: left | |
+box-sizing(border-box) | |
@for $n from 1 through $columns | |
.span-#{$n} | |
width: $column-width * $n | |
.offset-#{$n} | |
margin-left: $column-width * $n |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment