-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathgriddd.scss
137 lines (135 loc) · 3.09 KB
/
griddd.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
$width: 100%; //Container Width
$resize: 100% - 5%; //Container Width
$gutter: 0.5; //gutter size
$columns: 12; //number of columns
$slug: is !default; // change it to col if you're comfortable
$breakpoint-md: 48em; // tablets
$breakpoint-lg: 56.25em; // desktop
$breakpoint-xlg: 68.75em; // HD
html,
body {
margin: 0px;
}
/* For mobile phones: */
.container {
width: $resize;
margin: auto;
overflow: hidden;
}
.columns {
display: block;
box-sizing: border-box;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-flex: 0;
-ms-flex: 0 1 auto;
flex: 0 1 auto;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: row;
flex-direction: row;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
margin-right: -.5rem;
margin-left: -.5rem;
}
@for $i from 1 through $columns {
.#{$slug}-#{$i} {
width: $width + (100% - $width);
margin: +#{$gutter}em 0em 0em +#{$gutter}em;
padding-right: 0.5rem;
padding-left: 0.5rem;
}
}
/* For Tablets: */
@media only screen and (min-width: $breakpoint-md) {
.container {
width: $resize;
margin: auto;
}
.columns {
box-sizing: border-box;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-flex: 0;
-ms-flex: 0 1 auto;
flex: 0 1 auto;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-ms-flex-direction: row;
flex-direction: row;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
margin-right: -.5rem;
margin-left: -.5rem;
}
@for $i from 1 through $columns {
.#{$slug}-#{$i} {
flex: 0 0 auto;
box-sizing: border-box;
-webkit-box-flex: 0;
flex-basis: ($resize/$columns * $i)- $gutter;
max-width: ($resize/$columns * $i)- $gutter;
margin: +#{$gutter}rem 0rem 0rem +#{$gutter/2}rem;
padding-right: 0.5rem;
padding-left: 0.5rem;
}
}
}
/* For Desktops: */
@media only screen and (min-width: $breakpoint-xlg) {
.container {
width: $resize;
margin: auto;
}
.columns {
box-sizing: border-box;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-flex: 0;
-ms-flex: 0 1 auto;
flex: 0 1 auto;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-ms-flex-direction: row;
flex-direction: row;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
margin-right: -.5rem;
margin-left: -.5rem;
}
@for $i from 1 through $columns {
.#{$slug}-#{$i} {
flex: 0 0 auto;
box-sizing: border-box;
-webkit-box-flex: 0;
flex-basis: ($resize/$columns * $i)- $gutter;
max-width: ($resize/$columns * $i)- $gutter;
margin: +#{$gutter}rem 0rem 0rem +#{$gutter/2}rem;
padding-right: 0.5rem;
padding-left: 0.5rem;
}
}
}
/* Alignment: */
.start {
-webkit-box-pack: start;
-ms-flex-pack: start;
justify-content: flex-start;
text-align: start;
}
.center {
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
text-align: center;
}
.end {
-webkit-box-pack: end;
-ms-flex-pack: end;
justify-content: flex-end;
text-align: end;
}