Created
July 5, 2014 02:50
-
-
Save roperzh/e70f9aef727dcdd7c53c to your computer and use it in GitHub Desktop.
Very simple & effective grid system
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
// ------------------------------------------- | |
// Simple grid system | |
// ------------------------------------------- | |
/* Container for a group of columns */ | |
.grid { | |
width: 100%; | |
height: 100%; | |
@include clearfix(); | |
} | |
/* Target all the columns, and apply sensible defaults */ | |
.column, .columns { | |
float: left; | |
.grid &:last-of-type { | |
padding-right: 0; | |
} | |
} | |
.row { | |
clear: both; | |
} | |
/* | |
* Very simple column layout, every group of columns must be wrapped inside | |
* a container with the `.grid` class. | |
* | |
* The names of the columns try to be semantic as possible, so for example | |
* a column filling half of the screen could be done like this: | |
* | |
* <div class="grid"> | |
* <div class="five columns width"></div> | |
* </div> | |
*/ | |
$columns: one, two, three, four, five, six, seven, eight, nine, ten; | |
@for $i from 1 through length($columns) { | |
.#{nth($columns, $i)} { | |
width: #{$i * 10%}; | |
height: 50px; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment