1 | // Name: Slider
|
2 | // Description: Component to create horizontal sliders
|
3 | //
|
4 | // Component: `uk-slider`
|
5 | //
|
6 | // Sub-objects: `uk-slider-container`
|
7 | // `uk-slider-items`
|
8 | //
|
9 | // States: `uk-active`
|
10 | //
|
11 | // ========================================================================
|
12 |
|
13 |
|
14 | /* ========================================================================
|
15 | Component: Slider
|
16 | ========================================================================== */
|
17 |
|
18 | /*
|
19 | * 1. Prevent tab highlighting on iOS.
|
20 | */
|
21 |
|
22 | .uk-slider {
|
23 | /* 1 */
|
24 | -webkit-tap-highlight-color: transparent;
|
25 | @if(mixin-exists(hook-slider)) {@include hook-slider();}
|
26 | }
|
27 |
|
28 |
|
29 | /* Container
|
30 | ========================================================================== */
|
31 |
|
32 | /*
|
33 | * 1. Clip child elements
|
34 | */
|
35 |
|
36 | .uk-slider-container {
|
37 | /* 1 */
|
38 | overflow: hidden;
|
39 | }
|
40 |
|
41 | /* Items
|
42 | ========================================================================== */
|
43 |
|
44 | /*
|
45 | * 1. Optimize animation
|
46 | * 2. Create a containing block. In Safari it's neither created by `transform` nor `will-change`.
|
47 | */
|
48 |
|
49 | .uk-slider-items {
|
50 | /* 1 */
|
51 | will-change: transform;
|
52 | /* 2 */
|
53 | position: relative;
|
54 | }
|
55 |
|
56 | /*
|
57 | * 1. Reset list style without interfering with grid
|
58 | * 2. Prevent displaying the callout information on iOS.
|
59 | */
|
60 |
|
61 | .uk-slider-items:not(.uk-grid) {
|
62 | display: flex;
|
63 | /* 1 */
|
64 | margin: 0;
|
65 | padding: 0;
|
66 | list-style: none;
|
67 | /* 2 */
|
68 | -webkit-touch-callout: none;
|
69 | }
|
70 |
|
71 | .uk-slider-items.uk-grid { flex-wrap: nowrap; }
|
72 |
|
73 |
|
74 | /* Item
|
75 | ========================================================================== */
|
76 |
|
77 | /*
|
78 | * 1. Let items take content dimensions (0 0 auto)
|
79 | * 2. Create position context
|
80 | * 3. Disable horizontal panning gestures in IE11 and Edge
|
81 | * 4. Suppress outline on focus
|
82 | */
|
83 |
|
84 | .uk-slider-items > * {
|
85 | /* 1 */
|
86 | flex: none;
|
87 | /* 2 */
|
88 | position: relative;
|
89 | /* 3 */
|
90 | touch-action: pan-y;
|
91 | }
|
92 |
|
93 | /* 4 */
|
94 | .uk-slider-items > :focus { outline: none; }
|
95 |
|
96 |
|
97 | // Hooks
|
98 | // ========================================================================
|
99 |
|
100 | @if(mixin-exists(hook-slider-misc)) {@include hook-slider-misc();}
|
101 |
|
102 | // @mixin hook-slider(){}
|
103 | // @mixin hook-slider-misc(){}
|