-
Notifications
You must be signed in to change notification settings - Fork 1
/
_grid.scss
93 lines (76 loc) · 2.05 KB
/
_grid.scss
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//////////////////////////////////////
// Simple Semantic SASS Grid System // for SCSS: http://sass-lang.com/
//////////////////////////////////////
// Adapted from The Semantic Grid System: http://semantic.gs
// Defaults which you can freely override
$column-width: 60px;
$gutter-width: 15px;
$columns: 12;
// Set total width to 100% for responsive layout, set max width in pixels
$total-width: 100%;
$max-width: 1140px;
// Responsive Breakpoints, feel free to override or add more
$mobile: 768px;
$desktop: 960px;
// Add container for columns
@mixin container {
margin-left: auto;
margin-right: auto;
max-width: $max-width;
}
// Add alpha, omega mixins for nested grids
// Be aware that use of these classes will change the content width,
// e.g. they will not properly work on 3 column layouts
@mixin alpha {
padding-left: 0;
}
@mixin omega {
padding-right: 0;
}
// Utility function — you should never need to modify this
@function gridsystem-width($columns:$columns) {
@return ($column-width * $columns) + ($gutter-width * $columns);
}
// Set $total-width to 100% for a fluid layout
$total-width: gridsystem-width($columns);
// Uncomment these two lines and the star-hack width/margin lines below to enable sub-pixel fix for IE6 & 7. See http://tylertate.com/blog/2012/01/05/subpixel-rounding.html
// $min-width: 999999;
// $correction: 0.5 / $min-width * 100;
// The micro clearfix http://nicolasgallagher.com/micro-clearfix-hack/
@mixin clearfix() {
*zoom:1;
&:before,
&:after {
content:"";
display:table;
}
&:after {
clear:both;
}
}
//////////
// GRID //
//////////
body {
width: 100%;
@include clearfix();
}
@mixin column($x,$columns:$columns) {
display: inline;
float: left;
width: (1/$columns)*$x*(100%);
padding: 0 $gutter-width;
@include box-sizing(border-box);
@media screen and (max-width: $mobile) {
width: 100%;
left: 0;
}
}
@mixin push($offset:1) {
left: (1/$columns)*$offset*(100%);
position: relative;
}
@mixin pull($offset:1) {
left: -((1/$columns)*$offset*(100%));
position: relative;
}