1
|
// Name: Utility
|
2
|
// Description: Utilities collection
|
3
|
//
|
4
|
// Component: `uk-panel-*`
|
5
|
// `uk-clearfix`
|
6
|
// `uk-float-*`
|
7
|
// `uk-overflow-*`
|
8
|
// `uk-resize-*`
|
9
|
// `uk-display-*`
|
10
|
// `uk-inline-*`
|
11
|
// `uk-height-*`
|
12
|
// `uk-responsive-*`
|
13
|
// `uk-preserve-width`
|
14
|
// `uk-border-*`
|
15
|
// `uk-box-shadow-*`
|
16
|
// `uk-dropcap`
|
17
|
// `uk-leader`
|
18
|
// `uk-logo`
|
19
|
// `uk-svg`
|
20
|
// `uk-blend-*`
|
21
|
// `uk-transform-origin-*`
|
22
|
//
|
23
|
// States: `uk-disabled`
|
24
|
// `uk-drag`
|
25
|
// `uk-dragover`
|
26
|
// `uk-preserve`
|
27
|
//
|
28
|
// ========================================================================
|
29
|
|
30
|
|
31
|
// Variables
|
32
|
// ========================================================================
|
33
|
|
34
|
$panel-scrollable-height: 170px !default;
|
35
|
$panel-scrollable-padding: 10px !default;
|
36
|
$panel-scrollable-border-width: $global-border-width !default;
|
37
|
$panel-scrollable-border: $global-border !default;
|
38
|
|
39
|
$height-small-height: 150px !default;
|
40
|
$height-medium-height: 300px !default;
|
41
|
$height-large-height: 450px !default;
|
42
|
|
43
|
$border-rounded-border-radius: 5px !default;
|
44
|
|
45
|
$box-shadow-duration: 0.1s !default;
|
46
|
|
47
|
$dropcap-margin-right: 10px !default;
|
48
|
$dropcap-font-size: (($global-line-height * 3) * 1em) !default;
|
49
|
|
50
|
$leader-fill-content: '.' !default;
|
51
|
$leader-fill-margin-left: $global-small-gutter !default;
|
52
|
|
53
|
$logo-font-size: $global-large-font-size !default;
|
54
|
$logo-font-family: $global-font-family !default;
|
55
|
$logo-color: $global-color !default;
|
56
|
$logo-hover-color: $global-color !default;
|
57
|
|
58
|
$dragover-box-shadow: 0 0 20px rgba(100,100,100,0.3) !default;
|
59
|
|
60
|
|
61
|
/* ========================================================================
|
62
|
Component: Utility
|
63
|
========================================================================== */
|
64
|
|
65
|
|
66
|
/* Panel
|
67
|
========================================================================== */
|
68
|
|
69
|
.uk-panel {
|
70
|
position: relative;
|
71
|
box-sizing: border-box;
|
72
|
}
|
73
|
|
74
|
/*
|
75
|
* Micro clearfix
|
76
|
*/
|
77
|
|
78
|
.uk-panel::before,
|
79
|
.uk-panel::after {
|
80
|
content: "";
|
81
|
display: table;
|
82
|
}
|
83
|
|
84
|
.uk-panel::after { clear: both; }
|
85
|
|
86
|
/*
|
87
|
* Remove margin from the last-child
|
88
|
*/
|
89
|
|
90
|
.uk-panel > :last-child { margin-bottom: 0; }
|
91
|
|
92
|
|
93
|
/*
|
94
|
* Scrollable
|
95
|
*/
|
96
|
|
97
|
.uk-panel-scrollable {
|
98
|
height: $panel-scrollable-height;
|
99
|
padding: $panel-scrollable-padding;
|
100
|
border: $panel-scrollable-border-width solid $panel-scrollable-border;
|
101
|
overflow: auto;
|
102
|
-webkit-overflow-scrolling: touch;
|
103
|
resize: both;
|
104
|
@if(mixin-exists(hook-panel-scrollable)) {@include hook-panel-scrollable();}
|
105
|
}
|
106
|
|
107
|
|
108
|
/* Clearfix
|
109
|
========================================================================== */
|
110
|
|
111
|
/*
|
112
|
* 1. `table-cell` is used with `::before` because `table` creates a 1px gap when it becomes a flex item, only in Webkit
|
113
|
* 2. `table` is used again with `::after` because `clear` only works with block elements.
|
114
|
* Note: `display: block` with `overflow: hidden` is currently not working in the latest Safari
|
115
|
*/
|
116
|
|
117
|
/* 1 */
|
118
|
.uk-clearfix::before {
|
119
|
content: "";
|
120
|
display: table-cell;
|
121
|
}
|
122
|
|
123
|
/* 2 */
|
124
|
.uk-clearfix::after {
|
125
|
content: "";
|
126
|
display: table;
|
127
|
clear: both;
|
128
|
}
|
129
|
|
130
|
|
131
|
/* Float
|
132
|
========================================================================== */
|
133
|
|
134
|
/*
|
135
|
* 1. Prevent content overflow
|
136
|
*/
|
137
|
|
138
|
.uk-float-left { float: left; }
|
139
|
.uk-float-right { float: right; }
|
140
|
|
141
|
/* 1 */
|
142
|
[class*='uk-float-'] { max-width: 100%; }
|
143
|
|
144
|
|
145
|
/* Overfow
|
146
|
========================================================================== */
|
147
|
|
148
|
.uk-overflow-hidden { overflow: hidden; }
|
149
|
|
150
|
/*
|
151
|
* Enable scrollbars if content is clipped
|
152
|
*/
|
153
|
|
154
|
.uk-overflow-auto {
|
155
|
overflow: auto;
|
156
|
-webkit-overflow-scrolling: touch;
|
157
|
}
|
158
|
|
159
|
.uk-overflow-auto > :last-child { margin-bottom: 0; }
|
160
|
|
161
|
|
162
|
/* Resize
|
163
|
========================================================================== */
|
164
|
|
165
|
.uk-resize { resize: both; }
|
166
|
.uk-resize-vertical { resize: vertical; }
|
167
|
|
168
|
|
169
|
/* Display
|
170
|
========================================================================== */
|
171
|
|
172
|
.uk-display-block { display: block !important; }
|
173
|
.uk-display-inline { display: inline !important; }
|
174
|
.uk-display-inline-block { display: inline-block !important; }
|
175
|
|
176
|
|
177
|
/* Inline
|
178
|
========================================================================== */
|
179
|
|
180
|
/*
|
181
|
* 1. Container fits its content
|
182
|
* 2. Create position context
|
183
|
* 3. Prevent content overflow
|
184
|
* 4. Behave like most inline-block elements
|
185
|
* 5. Clip child elements
|
186
|
*/
|
187
|
|
188
|
[class*='uk-inline'] {
|
189
|
/* 1 */
|
190
|
display: inline-block;
|
191
|
/* 2 */
|
192
|
position: relative;
|
193
|
/* 3 */
|
194
|
max-width: 100%;
|
195
|
/* 4 */
|
196
|
vertical-align: middle;
|
197
|
}
|
198
|
|
199
|
.uk-inline-clip {
|
200
|
/* 5 */
|
201
|
overflow: hidden;
|
202
|
}
|
203
|
|
204
|
|
205
|
/* Height
|
206
|
========================================================================== */
|
207
|
|
208
|
[class*='uk-height'] { box-sizing: border-box; }
|
209
|
|
210
|
/*
|
211
|
* Only works if parent element has a height set
|
212
|
*/
|
213
|
|
214
|
.uk-height-1-1 { height: 100%; }
|
215
|
|
216
|
/*
|
217
|
* Useful to create image teasers
|
218
|
*/
|
219
|
|
220
|
.uk-height-viewport { min-height: 100vh; }
|
221
|
|
222
|
/*
|
223
|
* Pixel
|
224
|
* Useful for `overflow: auto`
|
225
|
*/
|
226
|
|
227
|
.uk-height-small { height: $height-small-height; }
|
228
|
.uk-height-medium { height: $height-medium-height; }
|
229
|
.uk-height-large { height: $height-large-height; }
|
230
|
|
231
|
.uk-height-max-small { max-height: $height-small-height; }
|
232
|
.uk-height-max-medium { max-height: $height-medium-height; }
|
233
|
.uk-height-max-large { max-height: $height-large-height; }
|
234
|
|
235
|
|
236
|
/* Responsive objects
|
237
|
========================================================================== */
|
238
|
|
239
|
/*
|
240
|
* Preserve original dimensions
|
241
|
* Because `img, `video`, `canvas` and `audio` are already responsive by default, see Base component
|
242
|
*/
|
243
|
|
244
|
.uk-preserve-width,
|
245
|
.uk-preserve-width audio,
|
246
|
.uk-preserve-width canvas,
|
247
|
.uk-preserve-width img,
|
248
|
.uk-preserve-width svg,
|
249
|
.uk-preserve-width video { max-width: none; }
|
250
|
|
251
|
/*
|
252
|
* Responsiveness
|
253
|
* Corrects `max-width` and `max-height` behavior if padding and border are used
|
254
|
*/
|
255
|
|
256
|
.uk-responsive-width,
|
257
|
.uk-responsive-height { box-sizing: border-box; }
|
258
|
|
259
|
/*
|
260
|
* 1. Set a maximum width. `important` needed to override `uk-preserve-width img`
|
261
|
* 2. Auto scale the height. Only needed if `height` attribute is present
|
262
|
*/
|
263
|
|
264
|
.uk-responsive-width {
|
265
|
/* 1 */
|
266
|
max-width: 100% !important;
|
267
|
/* 2 */
|
268
|
height: auto;
|
269
|
}
|
270
|
|
271
|
/*
|
272
|
* 1. Set a maximum height. Only works if the parent element has a fixed height
|
273
|
* 2. Auto scale the width. Only needed if `width` attribute is present
|
274
|
* 3. Reset max-width, which `img, `video`, `canvas` and `audio` already have by default
|
275
|
*/
|
276
|
|
277
|
.uk-responsive-height {
|
278
|
/* 1 */
|
279
|
max-height: 100%;
|
280
|
/* 2 */
|
281
|
width: auto;
|
282
|
/* 3 */
|
283
|
max-width: none;
|
284
|
}
|
285
|
|
286
|
|
287
|
/* Border
|
288
|
========================================================================== */
|
289
|
|
290
|
.uk-border-circle { border-radius: 50%; }
|
291
|
.uk-border-rounded { border-radius: $border-rounded-border-radius; }
|
292
|
|
293
|
/*
|
294
|
* Fix `overflow: hidden` to be ignored with border-radius and CSS transforms in Webkit
|
295
|
*/
|
296
|
|
297
|
.uk-inline-clip[class*='uk-border-'] { -webkit-transform: translateZ(0); }
|
298
|
|
299
|
|
300
|
/* Box-shadow
|
301
|
========================================================================== */
|
302
|
|
303
|
.uk-box-shadow-small { box-shadow: $global-small-box-shadow; }
|
304
|
.uk-box-shadow-medium { box-shadow: $global-medium-box-shadow; }
|
305
|
.uk-box-shadow-large { box-shadow: $global-large-box-shadow; }
|
306
|
.uk-box-shadow-xlarge { box-shadow: $global-xlarge-box-shadow; }
|
307
|
|
308
|
/*
|
309
|
* Hover
|
310
|
*/
|
311
|
|
312
|
[class*='uk-box-shadow-hover'] {
|
313
|
-webkit-transition: box-shadow $box-shadow-duration ease-in-out;
|
314
|
transition: box-shadow $box-shadow-duration ease-in-out;
|
315
|
}
|
316
|
|
317
|
.uk-box-shadow-hover-small:hover { box-shadow: $global-small-box-shadow; }
|
318
|
.uk-box-shadow-hover-medium:hover { box-shadow: $global-medium-box-shadow; }
|
319
|
.uk-box-shadow-hover-large:hover { box-shadow: $global-large-box-shadow; }
|
320
|
.uk-box-shadow-hover-xlarge:hover { box-shadow: $global-xlarge-box-shadow; }
|
321
|
|
322
|
|
323
|
/* Drop cap
|
324
|
========================================================================== */
|
325
|
|
326
|
.uk-dropcap::first-letter,
|
327
|
.uk-dropcap > p:first-of-type::first-letter {
|
328
|
display: block;
|
329
|
margin-right: $dropcap-margin-right;
|
330
|
float: left;
|
331
|
font-size: $dropcap-font-size;
|
332
|
line-height: 1;
|
333
|
@if(mixin-exists(hook-dropcap)) {@include hook-dropcap();}
|
334
|
}
|
335
|
|
336
|
|
337
|
/* Leader
|
338
|
========================================================================== */
|
339
|
|
340
|
.uk-leader { overflow: hidden; }
|
341
|
|
342
|
/*
|
343
|
* 1. Place element in text flow
|
344
|
* 2. Never break into a new line
|
345
|
* 3. Get a string back with as many repeating characters to fill the container
|
346
|
* 4. Prevent wrapping. Overflowing characters will be clipped by the container
|
347
|
*/
|
348
|
|
349
|
.uk-leader-fill::after {
|
350
|
/* 1 */
|
351
|
display: inline-block;
|
352
|
margin-left: $leader-fill-margin-left;
|
353
|
/* 2 */
|
354
|
width: 0;
|
355
|
/* 3 */
|
356
|
content: attr(data-fill);
|
357
|
/* 4 */
|
358
|
white-space: nowrap;
|
359
|
@if(mixin-exists(hook-leader)) {@include hook-leader();}
|
360
|
}
|
361
|
|
362
|
/*
|
363
|
* Hide if media does not match
|
364
|
*/
|
365
|
|
366
|
.uk-leader-fill.uk-leader-hide::after { display: none; }
|
367
|
|
368
|
/* Pass fill character to JS */
|
369
|
.var-leader-fill:before { content: $leader-fill-content; }
|
370
|
|
371
|
|
372
|
/* Logo
|
373
|
========================================================================== */
|
374
|
|
375
|
/*
|
376
|
* 1. Required for `a`
|
377
|
*/
|
378
|
|
379
|
.uk-logo {
|
380
|
font-size: $logo-font-size;
|
381
|
font-family: $logo-font-family;
|
382
|
color: $logo-color;
|
383
|
/* 1 */
|
384
|
text-decoration: none;
|
385
|
@if(mixin-exists(hook-logo)) {@include hook-logo();}
|
386
|
}
|
387
|
|
388
|
/* Hover + Focus */
|
389
|
.uk-logo:hover,
|
390
|
.uk-logo:focus {
|
391
|
color: $logo-hover-color;
|
392
|
outline: none;
|
393
|
/* 1 */
|
394
|
text-decoration: none;
|
395
|
@if(mixin-exists(hook-logo-hover)) {@include hook-logo-hover();}
|
396
|
}
|
397
|
|
398
|
.uk-logo-inverse { display: none; }
|
399
|
|
400
|
|
401
|
/* SVG
|
402
|
========================================================================== */
|
403
|
|
404
|
/*
|
405
|
* 1. Fill all SVG elements with the current text color if no `fill` attribute is set
|
406
|
* 2. Set the fill and stroke color of all SVG elements to the current text color
|
407
|
*/
|
408
|
|
409
|
/* 1 */
|
410
|
.uk-svg,
|
411
|
/* 2 */
|
412
|
.uk-svg:not(.uk-preserve) [fill*='#']:not(.uk-preserve) { fill: currentcolor; }
|
413
|
.uk-svg:not(.uk-preserve) [stroke*='#']:not(.uk-preserve) { stroke: currentcolor; }
|
414
|
|
415
|
/*
|
416
|
* Fix Firefox blurry SVG rendering: https://bugzilla.mozilla.org/show_bug.cgi?id=1046835
|
417
|
*/
|
418
|
|
419
|
.uk-svg { transform: translate(0,0); }
|
420
|
|
421
|
|
422
|
/* Disabled State
|
423
|
========================================================================== */
|
424
|
|
425
|
.uk-disabled { pointer-events: none; }
|
426
|
|
427
|
|
428
|
/* Drag State
|
429
|
========================================================================== */
|
430
|
|
431
|
/*
|
432
|
* 1. Needed if moving over elements with have their own cursor on hover, e.g. links or buttons
|
433
|
* 2. Fix dragging over iframes
|
434
|
*/
|
435
|
|
436
|
.uk-drag,
|
437
|
/* 1 */
|
438
|
.uk-drag * { cursor: move; }
|
439
|
|
440
|
/* 2 */
|
441
|
.uk-drag iframe { pointer-events: none; }
|
442
|
|
443
|
|
444
|
/* Dragover State
|
445
|
========================================================================== */
|
446
|
|
447
|
/*
|
448
|
* Create a box-shadow when dragging a file over the upload area
|
449
|
*/
|
450
|
|
451
|
.uk-dragover { box-shadow: $dragover-box-shadow; }
|
452
|
|
453
|
|
454
|
/* Blend modes
|
455
|
========================================================================== */
|
456
|
|
457
|
.uk-blend-multiply { mix-blend-mode: multiply; }
|
458
|
.uk-blend-screen { mix-blend-mode: screen; }
|
459
|
.uk-blend-overlay { mix-blend-mode: overlay; }
|
460
|
.uk-blend-darken { mix-blend-mode: darken; }
|
461
|
.uk-blend-lighten { mix-blend-mode: lighten; }
|
462
|
.uk-blend-color-dodge { mix-blend-mode: color-dodge; }
|
463
|
.uk-blend-color-burn { mix-blend-mode: color-burn; }
|
464
|
.uk-blend-hard-light { mix-blend-mode: hard-light; }
|
465
|
.uk-blend-soft-light { mix-blend-mode: soft-light; }
|
466
|
.uk-blend-difference { mix-blend-mode: difference; }
|
467
|
.uk-blend-exclusion { mix-blend-mode: exclusion; }
|
468
|
.uk-blend-hue { mix-blend-mode: hue; }
|
469
|
.uk-blend-saturation { mix-blend-mode: saturation; }
|
470
|
.uk-blend-color { mix-blend-mode: color; }
|
471
|
.uk-blend-luminosity { mix-blend-mode: luminosity; }
|
472
|
|
473
|
|
474
|
/* Transform Origin
|
475
|
========================================================================== */
|
476
|
|
477
|
.uk-transform-origin-top-left {
|
478
|
-webkit-transform-origin: 0 0;
|
479
|
transform-origin: 0 0;
|
480
|
}
|
481
|
|
482
|
.uk-transform-origin-top-center {
|
483
|
-webkit-transform-origin: 50% 0;
|
484
|
transform-origin: 50% 0;
|
485
|
}
|
486
|
|
487
|
.uk-transform-origin-top-right {
|
488
|
-webkit-transform-origin: 100% 0;
|
489
|
transform-origin: 100% 0;
|
490
|
}
|
491
|
|
492
|
.uk-transform-origin-center-left {
|
493
|
-webkit-transform-origin: 0 50%;
|
494
|
transform-origin: 0 50%;
|
495
|
}
|
496
|
|
497
|
.uk-transform-origin-center-right {
|
498
|
-webkit-transform-origin: 100% 50%;
|
499
|
transform-origin: 100% 50%;
|
500
|
}
|
501
|
|
502
|
.uk-transform-origin-bottom-left {
|
503
|
-webkit-transform-origin: 0 100%;
|
504
|
transform-origin: 0 100%;
|
505
|
}
|
506
|
|
507
|
.uk-transform-origin-bottom-center {
|
508
|
-webkit-transform-origin: 50% 100%;
|
509
|
transform-origin: 50% 100%;
|
510
|
}
|
511
|
|
512
|
.uk-transform-origin-bottom-right {
|
513
|
-webkit-transform-origin: 100% 100%;
|
514
|
transform-origin: 100% 100%;
|
515
|
}
|
516
|
|
517
|
|
518
|
// Hooks
|
519
|
// ========================================================================
|
520
|
|
521
|
@if(mixin-exists(hook-utility-misc)) {@include hook-utility-misc();}
|
522
|
|
523
|
// @mixin hook-panel-scrollable(){}
|
524
|
// @mixin hook-dropcap(){}
|
525
|
// @mixin hook-leader(){}
|
526
|
// @mixin hook-logo(){}
|
527
|
// @mixin hook-logo-hover(){}
|
528
|
// @mixin hook-utility-misc(){}
|
529
|
|
530
|
|
531
|
// Inverse
|
532
|
// ========================================================================
|
533
|
|
534
|
$inverse-logo-color: $inverse-global-color !default;
|
535
|
$inverse-logo-hover-color: $inverse-global-color !default;
|
536
|
|
537
|
|
538
|
|
539
|
// @mixin hook-inverse-dropcap(){}
|
540
|
// @mixin hook-inverse-leader(){}
|
541
|
// @mixin hook-inverse-logo(){}
|
542
|
// @mixin hook-inverse-logo-hover(){}
|