1
1
/* --------------------------------------------------------
2
2
Flex Grid System
3
3
4
- version: 0.03
4
+ version: 0.06
5
5
author: Karan Sharma
6
+ email: karan.sharma@zerodha.com
6
7
----------------------------------------------------------*/
7
8
8
9
$gutter : 10px ;
@@ -12,134 +13,123 @@ $breakpoint-desktop: 780px;
12
13
13
14
/* Grid
14
15
----------------------------------------------------------*/
16
+
15
17
.container {
16
18
position : relative ;
17
19
width : 100% ;
18
20
max-width : 960px ;
19
21
margin : 0 auto ;
20
- padding : 0 $gutter ;
22
+ padding : $gutter * 2 ;
21
23
box-sizing : border-box ;
22
24
}
23
25
24
26
.row {
25
27
box-sizing : border-box ;
26
- display :flex ;
28
+ display : flex ;
27
29
flex : 0 1 auto ;
28
30
flex-flow : row wrap ;
29
- // margin: 0 $gutter;
31
+ margin : 0 $gutter ;
32
+ & .nogutter {
33
+ margin-left : 0 ;
34
+ margin-right : 0 ;
35
+ & > .columns {
36
+ padding-left : 0 ;
37
+ padding-right : 0 ;
38
+ }
39
+ }
30
40
}
31
41
32
42
// Columns
33
43
34
- .columns , .column {
44
+ .columns {
35
45
box-sizing : border-box ;
36
- flex-grow : 1 ;
37
- flex-shrink : 1 ;
38
- flex-basis : 1 ;
39
- margin : $gutter 0 $gutter 4% ;
40
- }
41
-
42
- .column :first-child ,
43
- .columns :first-child {
44
- margin-left : 0 ;
46
+ flex : 0 1 auto ;
47
+ padding : 0 $gutter ;
45
48
}
46
-
47
- .one {
48
- max-width : 4.66666666667% ;
49
+ .one {
50
+ flex-basis : 8.33333333% ;
49
51
}
50
-
51
52
.two {
52
- max-width : 13.3333333333 % ;
53
+ flex-basis : 16.66666667 % ;
53
54
}
54
-
55
55
.three {
56
- max-width : 22 % ;
56
+ flex-basis : 25 % ;
57
57
}
58
-
59
58
.four {
60
- max-width : 30.6666666667 % ;
59
+ flex-basis : 33.3333333333 % ;
61
60
}
62
-
63
61
.five {
64
- max-width : 39.3333333333 % ;
62
+ flex-basis : 41.66666667 % ;
65
63
}
66
-
67
64
.six {
68
- max-width : 48 % ;
65
+ flex-basis : 50 % ;
69
66
}
70
-
71
67
.seven {
72
- max-width : 56.6666666667 % ;
68
+ flex-basis : 58.33333333 % ;
73
69
}
74
-
75
70
.eight {
76
- max-width : 65.3333333333 % ;
71
+ flex-basis : 66.66666667 % ;
77
72
}
78
-
79
73
.nine {
80
- max-width : 74.0 % ; ;
74
+ flex-basis : 75 % ;
81
75
}
82
-
83
76
.ten {
84
- max-width : 82.6666666667 % ;
77
+ flex-basis : 83.33333333 % ;
85
78
}
86
-
87
79
.eleven {
88
- max-width : 91.3333333333 % ;
80
+ flex-basis : 91.66666667 % ;
89
81
}
90
-
91
82
.twelve {
92
- max-width : 100% ;
93
- margin-left : 0 ;
83
+ flex-basis : 100% ;
94
84
}
95
85
96
86
// Offsets
97
87
98
- .column -offset-0 {
88
+ .col -offset-0 {
99
89
margin-left : 0 ;
100
90
}
101
91
102
- .column -offset-1 {
92
+ .col -offset-1 {
103
93
margin-left : 8.33333333% ;
104
94
}
105
95
106
- .column -offset-2 {
96
+ .col -offset-2 {
107
97
margin-left : 16.66666667% ;
108
98
}
109
99
110
- .column -offset-3 {
100
+ .col -offset-3 {
111
101
margin-left : 25% ;
112
102
}
113
103
114
- .column -offset-4 {
104
+ .col -offset-4 {
115
105
margin-left : 33.33333333% ;
116
106
}
117
107
118
- .column -offset-5 {
108
+ .col -offset-5 {
119
109
margin-left : 41.66666667% ;
120
110
}
121
111
122
- .column -offset-6 {
112
+ .col -offset-6 {
123
113
margin-left : 50% ;
124
114
}
125
115
126
- .column -offset-7 {
116
+ .col -offset-7 {
127
117
margin-left : 58.33333333% ;
128
118
}
129
119
130
- .column -offset-8 {
120
+ .col -offset-8 {
131
121
margin-left : 66.66666667% ;
132
122
}
133
123
134
- .column -offset-9 {
124
+ .col -offset-9 {
135
125
margin-left : 75% ;
136
126
}
137
127
138
- .column -offset-10 {
128
+ .col -offset-10 {
139
129
margin-left : 83.33333333% ;
140
130
}
141
131
142
- .column -offset-11 {
132
+ .col -offset-11 {
143
133
margin-left : 91.66666667% ;
144
134
}
145
135
@@ -151,99 +141,60 @@ $breakpoint-desktop: 780px;
151
141
justify-content : space-between ;
152
142
}
153
143
154
- .evenly {
155
- justify-content : space-evenly ;
156
- }
157
-
158
- .around {
159
- justify-content : space-around ;
160
- }
161
-
162
- .center {
163
- justify-content : center ;
164
- text-align : center ;
165
- }
166
-
167
- .start {
168
- justify-content : flex-start ;
169
- }
170
-
171
144
.end {
172
145
justify-content : flex-end ;
173
146
}
174
147
175
- .top {
176
- align-items : flex-start ;
177
- }
178
-
179
- .bottom {
180
- align-items : flex-end ;
181
- }
182
-
183
- .middle {
184
- align-items : center ;
185
- }
186
-
187
- .first {
188
- order : -1 ;
189
- }
190
-
191
- .last {
192
- order : 1 ;
193
- }
194
-
195
- .vertical {
196
- flex-flow : column wrap ;
148
+ .around {
149
+ justify-content : space-around ;
197
150
}
198
151
199
152
.row-align-center {
200
153
align-items : center ;
201
154
}
202
155
203
156
.space-right {
204
- margin-right : $gutter ;
157
+ margin-right : $gutter ;
205
158
}
206
159
207
160
.space-left {
208
- margin-left : $gutter ;
161
+ margin-left : $gutter ;
209
162
}
210
163
211
164
.space-bottom {
212
- margin-bottom : $gutter ;
165
+ margin-bottom : $gutter ;
213
166
}
214
167
215
168
.space-top {
216
- margin-top : $gutter ;
169
+ margin-top : $gutter ;
217
170
}
218
171
219
-
220
-
221
172
/*
222
173
##Device = Low Resolution Tablets, Mobiles (Landscape)
223
174
##Screen = B/w $breakpoint-tablet to $breakpoint-desktop
224
175
*/
225
176
226
- @media screen and (max-width : 768 px ) {
227
- .container {
228
- overflow : auto ;
177
+ @media ( min-width : $breakpoint-mobile ) and (max-width : $breakpoint-desktop ) {
178
+ .columns {
179
+ flex : 1 1 auto ;
229
180
}
230
- .columns , .column {
231
- min-width : 100% ;
232
- margin : $gutter 0 ;
233
- }
234
- .column-offset-0 ,
235
- .column-offset-1 ,
236
- .column-offset-2 ,
237
- .column-offset-3 ,
238
- .column-offset-4 ,
239
- .column-offset-5 ,
240
- .column-offset-6 ,
241
- .column-offset-7 ,
242
- .column-offset-8 ,
243
- .column-offset-9 ,
244
- .column-offset-10 ,
245
- .column-offset-11 ,
246
- {
181
+ .offset-0 , .offset-1 , .offset-2 {
247
182
margin : unset ;
248
183
}
184
+
249
185
}
186
+
187
+ /*
188
+ ##Device = Most of the Smartphones Mobiles (Portrait)
189
+ ##Screen = B/w $breakpoint-mobile to $breakpoint-tablet-1px
190
+ */
191
+
192
+ // @media (min-width: $breakpoint-mobile) and (max-width: calc($breakpoint-tablet-1px)) {
193
+
194
+ // .columns {
195
+ // box-sizing: border-box;
196
+ // flex: 0 0 auto;
197
+ // }
198
+
199
+ // }
200
+
0 commit comments