-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_grid.sass
35 lines (29 loc) · 1 KB
/
_grid.sass
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//Grid system adapted from http://1kbgrid.com/ by Tyler Tate
//Set up your column sizes
$column_width: 60
$column_count: 12
$column_gutter: 20
$total_width: $column_width * $column_count + $column_gutter * $column_count * 1px
// Creates classes like .grid_2 for a 2-column-wide grid.
@for $i from 1 to $column_count + 1
.grid_#{$i}
:width ($i * $column_width + ($i - 1) * $column_gutter) * 1px
// Creates mixins like +grid(2, 2px) for a 2-column-wide grid that has a 1px border around the edge.
// The columns arguments defaults to the maximum width.
// The border argument defaults to zero.
=grid($cols: $column_count, $border: 0px)
:width ($cols * $column_width + ($cols - 1) * $column_gutter) * 1px - $border
//Set the width of rows and center them on tha page.
.row
:width $total_width
:margin 0 auto
:overflow hidden
.row
:margin 0 $column_gutter /2 * -1px
:width auto
:display inline-block
.column
:float left
:margin 0 $column_gutter /2 * 1px
:overflow hidden
:display inline