Project

General

Profile

1
// Name:            Flex
2
// Description:     Utilities for layouts based on flexbox
3
//
4
// Component:       `uk-flex-*`
5
//
6
// ========================================================================
7

    
8

    
9
/* ========================================================================
10
   Component: Flex
11
 ========================================================================== */
12

    
13
.uk-flex {
14
    display: -ms-flexbox;
15
    display: -webkit-flex;
16
    display: flex;
17
}
18

    
19
.uk-flex-inline {
20
    display: -ms-inline-flexbox;
21
    display: -webkit-inline-flex;
22
    display: inline-flex;
23
}
24

    
25
/*
26
 * Remove pseudo elements created by micro clearfix as precaution
27
 */
28

    
29
.uk-flex::before,
30
.uk-flex::after,
31
.uk-flex-inline::before,
32
.uk-flex-inline::after { display: none; }
33

    
34

    
35
/* Alignment
36
 ========================================================================== */
37

    
38
/*
39
 * Align items along the main axis of the current line of the flex container
40
 * Row: Horizontal
41
 */
42

    
43
// Default
44
.uk-flex-left {
45
    -ms-flex-pack: start;
46
    -webkit-justify-content: flex-start;
47
    justify-content: flex-start;
48
}
49

    
50
.uk-flex-center {
51
    -ms-flex-pack: center;
52
    -webkit-justify-content: center;
53
    justify-content: center;
54
}
55

    
56
.uk-flex-right {
57
    -ms-flex-pack: end;
58
    -webkit-justify-content: flex-end;
59
    justify-content: flex-end;
60
}
61

    
62
.uk-flex-between {
63
    -ms-flex-pack: justify;
64
    -webkit-justify-content: space-between;
65
    justify-content: space-between;
66
}
67

    
68
.uk-flex-around {
69
    -ms-flex-pack: distribute;
70
    -webkit-justify-content: space-around;
71
    justify-content: space-around;
72
}
73

    
74

    
75
/* Phone landscape and bigger */
76
@media (min-width: @breakpoint-small) {
77

    
78
    .uk-flex-left\@s {
79
        -ms-flex-pack: start;
80
        -webkit-justify-content: flex-start;
81
        justify-content: flex-start;
82
    }
83

    
84
    .uk-flex-center\@s {
85
        -ms-flex-pack: center;
86
        -webkit-justify-content: center;
87
        justify-content: center;
88
    }
89

    
90
    .uk-flex-right\@s {
91
        -ms-flex-pack: end;
92
        -webkit-justify-content: flex-end;
93
        justify-content: flex-end;
94
    }
95

    
96
    .uk-flex-between\@s {
97
        -ms-flex-pack: justify;
98
        -webkit-justify-content: space-between;
99
        justify-content: space-between;
100
    }
101

    
102
    .uk-flex-around\@s {
103
        -ms-flex-pack: distribute;
104
        -webkit-justify-content: space-around;
105
        justify-content: space-around;
106
    }
107

    
108
}
109

    
110
/* Tablet landscape and bigger */
111
@media (min-width: @breakpoint-medium) {
112

    
113
    .uk-flex-left\@m {
114
        -ms-flex-pack: start;
115
        -webkit-justify-content: flex-start;
116
        justify-content: flex-start;
117
    }
118

    
119
    .uk-flex-center\@m {
120
        -ms-flex-pack: center;
121
        -webkit-justify-content: center;
122
        justify-content: center;
123
    }
124

    
125
    .uk-flex-right\@m {
126
        -ms-flex-pack: end;
127
        -webkit-justify-content: flex-end;
128
        justify-content: flex-end;
129
    }
130

    
131
    .uk-flex-between\@m {
132
        -ms-flex-pack: justify;
133
        -webkit-justify-content: space-between;
134
        justify-content: space-between;
135
    }
136

    
137
    .uk-flex-around\@m {
138
        -ms-flex-pack: distribute;
139
        -webkit-justify-content: space-around;
140
        justify-content: space-around;
141
    }
142

    
143
}
144

    
145
/* Desktop and bigger */
146
@media (min-width: @breakpoint-large) {
147

    
148
    .uk-flex-left\@l {
149
        -ms-flex-pack: start;
150
        -webkit-justify-content: flex-start;
151
        justify-content: flex-start;
152
    }
153

    
154
    .uk-flex-center\@l {
155
        -ms-flex-pack: center;
156
        -webkit-justify-content: center;
157
        justify-content: center;
158
    }
159

    
160
    .uk-flex-right\@l {
161
        -ms-flex-pack: end;
162
        -webkit-justify-content: flex-end;
163
        justify-content: flex-end;
164
    }
165

    
166
    .uk-flex-between\@l {
167
        -ms-flex-pack: justify;
168
        -webkit-justify-content: space-between;
169
        justify-content: space-between;
170
    }
171

    
172
    .uk-flex-around\@l {
173
        -ms-flex-pack: distribute;
174
        -webkit-justify-content: space-around;
175
        justify-content: space-around;
176
    }
177

    
178
}
179

    
180
/* Large screen and bigger */
181
@media (min-width: @breakpoint-xlarge) {
182

    
183
    .uk-flex-left\@xl {
184
        -ms-flex-pack: start;
185
        -webkit-justify-content: flex-start;
186
        justify-content: flex-start;
187
    }
188

    
189
    .uk-flex-center\@xl {
190
        -ms-flex-pack: center;
191
        -webkit-justify-content: center;
192
        justify-content: center;
193
    }
194

    
195
    .uk-flex-right\@xl {
196
        -ms-flex-pack: end;
197
        -webkit-justify-content: flex-end;
198
        justify-content: flex-end;
199
    }
200

    
201
    .uk-flex-between\@xl {
202
        -ms-flex-pack: justify;
203
        -webkit-justify-content: space-between;
204
        justify-content: space-between;
205
    }
206

    
207
    .uk-flex-around\@xl {
208
        -ms-flex-pack: distribute;
209
        -webkit-justify-content: space-around;
210
        justify-content: space-around;
211
    }
212

    
213
}
214

    
215
/*
216
 * Align items in the cross axis of the current line of the flex container
217
 * Row: Vertical
218
 */
219

    
220
// Default
221
.uk-flex-stretch {
222
    -ms-flex-align: stretch;
223
    -webkit-align-items: stretch;
224
    align-items: stretch;
225
}
226

    
227
.uk-flex-top {
228
    -ms-flex-align: start;
229
    -webkit-align-items: flex-start;
230
    align-items: flex-start;
231
}
232

    
233
.uk-flex-middle {
234
    -ms-flex-align: center;
235
    -webkit-align-items: center;
236
    align-items: center;
237
}
238

    
239
.uk-flex-bottom {
240
    -ms-flex-align: end;
241
    -webkit-align-items: flex-end;
242
    align-items: flex-end;
243
}
244

    
245

    
246
/* Direction
247
 ========================================================================== */
248

    
249
// Default
250
.uk-flex-row {
251
    -ms-flex-direction: row;
252
    -webkit-flex-direction: row;
253
    flex-direction: row;
254
}
255

    
256
.uk-flex-row-reverse {
257
    -ms-flex-direction: row-reverse;
258
    -webkit-flex-direction: row-reverse;
259
    flex-direction: row-reverse;
260
}
261

    
262
.uk-flex-column {
263
    -ms-flex-direction: column;
264
    -webkit-flex-direction: column;
265
    flex-direction: column;
266
}
267

    
268
.uk-flex-column-reverse {
269
    -ms-flex-direction: column-reverse;
270
    -webkit-flex-direction: column-reverse;
271
    flex-direction: column-reverse;
272
}
273

    
274

    
275
/* Wrap
276
 ========================================================================== */
277

    
278
// Default
279
.uk-flex-nowrap {
280
    -ms-flex-wrap: nowrap;
281
    -webkit-flex-wrap: nowrap;
282
    flex-wrap: nowrap;
283
}
284

    
285
.uk-flex-wrap {
286
    -ms-flex-wrap: wrap;
287
    -webkit-flex-wrap: wrap;
288
    flex-wrap: wrap;
289
}
290

    
291
.uk-flex-wrap-reverse {
292
    -ms-flex-wrap: wrap-reverse;
293
    -webkit-flex-wrap: wrap-reverse;
294
    flex-wrap: wrap-reverse;
295
}
296

    
297
/*
298
 * Aligns items within the flex container when there is extra space in the cross-axis
299
 * Only works if there is more than one line of flex items
300
 */
301

    
302
// Default
303
.uk-flex-wrap-stretch {
304
    -ms-flex-line-pack: stretch;
305
    -webkit-align-content: stretch;
306
    align-content: stretch;
307
}
308

    
309
.uk-flex-wrap-top {
310
    -ms-flex-line-pack: start;
311
    -webkit-align-content: flex-start;
312
    align-content: flex-start;
313
}
314

    
315
.uk-flex-wrap-middle {
316
    -ms-flex-line-pack: center;
317
    -webkit-align-content: center;
318
    align-content: center;
319
}
320

    
321
.uk-flex-wrap-bottom {
322
    -ms-flex-line-pack: end;
323
    -webkit-align-content: flex-end;
324
    align-content: flex-end;
325
}
326

    
327
.uk-flex-wrap-between {
328
    -ms-flex-line-pack: justify;
329
    -webkit-align-content: space-between;
330
    align-content: space-between;
331
}
332

    
333
.uk-flex-wrap-around {
334
    -ms-flex-line-pack: distribute;
335
    -webkit-align-content: space-around;
336
    align-content: space-around;
337
}
338

    
339

    
340
/* Item ordering
341
 ========================================================================== */
342

    
343
/*
344
 * Default is 0
345
 */
346

    
347
.uk-flex-first {
348
    -ms-flex-order: -1;
349
    -webkit-order: -1;
350
    order: -1;
351
}
352

    
353
.uk-flex-last {
354
    -ms-flex-order: 99;
355
    -webkit-order: 99;
356
    order: 99;
357
}
358

    
359

    
360
/* Phone landscape and bigger */
361
@media (min-width: @breakpoint-small) {
362

    
363
    .uk-flex-first\@s {
364
        -ms-flex-order: -1;
365
        -webkit-order: -1;
366
        order: -1;
367
    }
368

    
369
    .uk-flex-last\@s {
370
        -ms-flex-order: 99;
371
        -webkit-order: 99;
372
        order: 99;
373
    }
374

    
375
}
376

    
377
/* Tablet landscape and bigger */
378
@media (min-width: @breakpoint-medium) {
379

    
380
    .uk-flex-first\@m {
381
        -ms-flex-order: -1;
382
        -webkit-order: -1;
383
        order: -1;
384
    }
385

    
386
    .uk-flex-last\@m {
387
        -ms-flex-order: 99;
388
        -webkit-order: 99;
389
        order: 99;
390
    }
391

    
392
}
393

    
394
/* Desktop and bigger */
395
@media (min-width: @breakpoint-large) {
396

    
397
    .uk-flex-first\@l {
398
        -ms-flex-order: -1;
399
        -webkit-order: -1;
400
        order: -1;
401
    }
402

    
403
    .uk-flex-last\@l {
404
        -ms-flex-order: 99;
405
        -webkit-order: 99;
406
        order: 99;
407
    }
408

    
409
}
410

    
411
/* Large screen and bigger */
412
@media (min-width: @breakpoint-xlarge) {
413

    
414
    .uk-flex-first\@xl {
415
        -ms-flex-order: -1;
416
        -webkit-order: -1;
417
        order: -1;
418
    }
419

    
420
    .uk-flex-last\@xl {
421
        -ms-flex-order: 99;
422
        -webkit-order: 99;
423
        order: 99;
424
    }
425

    
426
}
427

    
428

    
429
/* Item dimensions
430
 ========================================================================== */
431

    
432
/*
433
 * Initial: 0 1 auto
434
 * Content dimensions, but shrinks
435
 */
436

    
437
/*
438
 * No Flex: 0 0 auto
439
 * Content dimensions
440
 */
441

    
442
.uk-flex-none {
443
    -ms-flex: none;
444
    -webkit-flex: none;
445
    flex: none;
446
}
447

    
448
/*
449
 * Relative Flex: 1 1 auto
450
 * Space is allocated considering content
451
 */
452

    
453
.uk-flex-auto {
454
    -ms-flex: auto;
455
    -webkit-flex: auto;
456
    flex: auto;
457
}
458

    
459
/*
460
 * Absolute Flex: 1 1 0%
461
 * Space is allocated solely based on flex
462
 */
463

    
464
.uk-flex-1 {
465
    -ms-flex: 1;
466
    -webkit-flex: 1;
467
    flex: 1;
468
}
469

    
470

    
471
// Hooks
472
// ========================================================================
473

    
474
.hook-flex-misc;
475

    
476
.hook-flex-misc() {}
(24-24/66)