This repository has been archived by the owner on Apr 25, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
_grid.scss
200 lines (160 loc) · 2.68 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
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
/**
* Grid
*/
.grid,
%grid {
@include grid;
}
/**
* Grid Gutter X
*/
.g-gutter-x,
%g-gutter-x {
@include grid-gutter-x;
}
/**
* Grid Gutter Y
*/
.g-gutter-y,
%g-gutter-y {
@include grid-gutter-y;
}
/**
* Grid Gutter
*/
@each $key, $value in $gutters {
@if $key == base {
.g-gutter-x,
%g-gutter-x {
@include grid-gutter-x($value);
}
} @else {
.g-gutter-x-#{$key},
%g-gutter-x-#{$key} {
@include grid-gutter-x($value);
}
}
@if $key == base {
.g-gutter-y,
%g-gutter-y {
@include grid-gutter-y($value);
}
} @else {
.g-gutter-y-#{$key},
%g-gutter-y-#{$key} {
@include grid-gutter-y($value);
}
}
@if $key == base {
.g-gutter,
%g-gutter {
@extend %g-gutter-x;
@extend %g-gutter-y;
}
} @else {
.g-gutter-#{$key},
%g-gutter-#{$key} {
@extend %g-gutter-x-#{$key};
@extend %g-gutter-y-#{$key};
}
}
}
/**
* Grid Center X
*/
.g-center-x,
%g-center-x {
@include justify-content(center);
}
/**
* Grid Center Y
*/
.g-center-y,
%g-center-y {
@include align-items(center);
}
/**
* Grid Center
*/
.g-center,
%g-center {
@include justify-content(center);
@include align-items(center);
}
/**
* Grid Baseline
*/
.g-baseline,
%g-baseline {
@include align-items(flex-end);
}
/**
* Grid Space
*/
.g-space,
%g-space {
@include justify-content(space-between);
}
/**
* Grid Reverse
*/
.g-reverse,
%g-reverse {
@include flex-direction(row-reverse);
}
/**
* Grid Collapse
*/
.g-collapse,
%g-collapse {
> * {
width: auto;
}
}
/**
* Grid Stretch
*/
.g-stretch-first,
%g-stretch-first {
@extend %g-collapse;
@include flex-wrap(nowrap);
> *:first-child {
flex-grow: 1;
}
> *:last-child {
flex-shrink: 0;
}
}
.g-stretch-last,
%g-stretch-last {
@extend %g-collapse;
@include flex-wrap(nowrap);
> *:first-child {
flex-shrink: 0;
}
> *:last-child {
flex-grow: 1;
}
}
/**
* Grid Cols
*/
@each $screen, $value in $screens {
@if $screen == xs {
@for $i from 1 through 12 {
.g-col-#{$screen}-#{$i},
%g-col-#{$screen}-#{$i} {
@include grid-col($i of 12);
}
}
} @else {
@include breakpoint(screen($screen)) {
@for $i from 1 through 12 {
.g-col-#{$screen}-#{$i},
%g-col-#{$screen}-#{$i} {
@include grid-col($i of 12);
}
}
}
}
}