|
1 | | - |
2 | | - /* Body, root elements |
3 | | - * Sets a default cursor on the body, blocks text selection. |
4 | | - */ |
5 | | - .noUi-root * { |
| 1 | + |
| 2 | +/* General CSS resets; |
| 3 | + * The target itself is not affected, allowing |
| 4 | + * the remainder of the document to use an |
| 5 | + * alternate box-sizing model; |
| 6 | + * Support for box-sizing is wide spread: |
| 7 | + * http://caniuse.com/#search=box-sizing |
| 8 | + */ |
| 9 | + .noUi-target * { |
| 10 | +-webkit-box-sizing: border-box; |
| 11 | + -moz-box-sizing: border-box; |
6 | 12 | box-sizing: border-box; |
7 | | - display: block; |
8 | | - margin: 0; |
9 | | - padding: 0; |
10 | | - border: 0; |
| 13 | +-webkit-touch-callout: none; |
| 14 | + -ms-touch-action: none; |
| 15 | +-webkit-user-select: none; |
| 16 | + -moz-user-select: none; |
| 17 | + -ms-user-select: none; |
| 18 | + cursor: default; |
11 | 19 | } |
12 | | - .noUi-root *, |
13 | | - body[data-nouislider-active] { |
14 | | - -webkit-user-select: none; |
15 | | - -moz-user-select: none; |
16 | | - -ms-user-select: none; |
17 | | - -ms-touch-action: none; |
| 20 | + |
| 21 | +/* Main slider bar; |
| 22 | + */ |
| 23 | + .noUi-base { |
| 24 | + height: 40px; |
| 25 | + width: 300px; |
| 26 | + position: relative; |
| 27 | + max-width: 100%; |
| 28 | + border: 1px solid #bfbfbf; |
| 29 | + z-index: 1; |
18 | 30 | } |
19 | | - body[data-nouislider-active] * { |
20 | | - cursor: default !important; |
| 31 | + |
| 32 | +/* Handles + active state; |
| 33 | + */ |
| 34 | + .noUi-handle { |
| 35 | + background: #EEE; |
| 36 | + height: 44px; |
| 37 | + width: 44px; |
| 38 | + border: 1px solid #BFBFBF; |
| 39 | + margin: -3px 0 0 -23px; |
| 40 | + } |
| 41 | + .noUi-active { |
| 42 | + background: #E9E9E9; |
| 43 | + } |
| 44 | + .noUi-active:after { |
| 45 | + content: ""; |
| 46 | + display: block; |
| 47 | + height: 100%; |
| 48 | + border: 1px solid #DDD; |
21 | 49 | } |
22 | 50 |
|
23 | | - /* Basics |
24 | | - * |
25 | | - */ |
26 | | - .noUi-slider { |
27 | | - position: relative; |
| 51 | +/* Styling-only classes; |
| 52 | + * Structured to prevent double declarations |
| 53 | + * for various states of the slider. |
| 54 | + */ |
| 55 | + .noUi-connect { |
| 56 | + background: Teal; |
| 57 | + } |
| 58 | + .noUi-background { |
| 59 | + background: #DDD; |
28 | 60 | } |
29 | | - .noUi-slider b { |
| 61 | + |
| 62 | +/* Functional styles for handle positioning; |
| 63 | + * Note that the origins have z-index 0, the base has |
| 64 | + * z-index 1; This fixes a bug where borders become invisible. |
| 65 | + */ |
| 66 | + .noUi-origin { |
30 | 67 | position: absolute; |
31 | | - z-index: 1; |
| 68 | + right: 0; |
| 69 | + top: 0; |
| 70 | + bottom: 0; |
| 71 | + z-index: 0; |
32 | 72 | } |
33 | | - .noUi-slider b + b { |
34 | | - /* Fallback for older browsers... :( */ |
35 | | - background: #d9d7cb !important; |
| 73 | + .noUi-origin-upper { |
36 | 74 | background: inherit !important; |
37 | 75 | } |
38 | | - .noUi-horizontal { |
39 | | - width: 100%; |
40 | | - height: 12px; |
41 | | - } |
42 | | - .noUi-horizontal b { |
43 | | - height: 100%; |
44 | | - right: 0; |
| 76 | + .noUi-z-index { |
| 77 | + z-index: 10; |
45 | 78 | } |
| 79 | + |
| 80 | +/* Adaptations for the vertical slider; |
| 81 | + */ |
46 | 82 | .noUi-vertical { |
47 | | - height: 100%; |
48 | | - width: 12px; |
| 83 | + height: 300px; |
| 84 | + width: 40px; |
| 85 | + max-height: 100%; |
49 | 86 | } |
50 | | - .noUi-vertical b { |
51 | | - width: 100%; |
| 87 | + .noUi-vertical .noUi-origin { |
52 | 88 | bottom: 0; |
| 89 | + left: 0; |
53 | 90 | } |
54 | | - |
55 | | - /* Looks |
56 | | - * |
57 | | - */ |
58 | | - .noUi-slider { |
59 | | - border: 1px solid #908d84; |
60 | | - border-radius: 3px; |
61 | | - } |
62 | | - .noUi-slider.noUi-connect.noUi-lower, |
63 | | - .noUi-slider.noUi-connect b { |
64 | | - background: #b2a98f; |
65 | | - } |
66 | | - .noUi-slider, |
67 | | - .noUi-slider.noUi-connect.noUi-lower b { |
68 | | - background: #d9d7cb; |
69 | | - box-shadow: inset 0px 1px 7px #b6b4a8; |
70 | | - } |
71 | | - .noUi-slider b { |
72 | | - border-radius: 2px; |
73 | | - } |
74 | | - .noUi-slider i { |
75 | | - width: 18px; |
76 | | - height: 18px; |
77 | | - border: 1px solid #999; |
78 | | - border-radius: 3px; |
79 | | - background: #efefef; |
80 | | - -webkit-transition: all 0.2s; |
81 | | - transition: all 0.2s; |
82 | | - } |
83 | | - .noUi-horizontal i { |
84 | | - margin: -4px 0 0 -9px; |
85 | | - } |
86 | | - .noUi-vertical i { |
87 | | - margin: -9px 0 0 -4px; |
88 | | - } |
89 | | - |
90 | | - /* Hover and active states |
91 | | - * |
92 | | - */ |
93 | | - .noUi-slider .noUi-base-active { |
94 | | - z-index: 3 !important; |
95 | | - } |
96 | | - .noUi-slider i.noUi-active, |
97 | | - .noUi-slider i:hover { |
98 | | - border-color: #aaa; |
99 | | - background: #fff; |
100 | | - width: 26px; |
101 | | - height: 26px; |
102 | | - margin: -8px 0 0 -13px; |
103 | | - } |
104 | | - .noUi-vertical i.noUi-active, |
105 | | - .noUi-vertical i:hover { |
106 | | - margin: -4px 0 0 -9px; |
| 91 | + .noUi-vertical .noUi-handle { |
| 92 | + margin: -23px 0 0 -3px; |
107 | 93 | } |
108 | 94 |
|
109 | | - /* Disabled |
110 | | - * |
111 | | - */ |
112 | | - .noUi-root[disabled="disabled"] .noUi-slider { |
113 | | - background: #ccc; |
114 | | - } |
115 | | - .noUi-root[disabled="disabled"] i:hover, |
116 | | - .noUi-root[disabled="disabled"] i { |
| 95 | +/* Various alternate slider states; |
| 96 | + * Support for transition is widely available, |
| 97 | + * Only IE7, IE8 and IE9 will ignore these rules. |
| 98 | + * Since this is merely a progressive enhancement, |
| 99 | + * this is no problem at all. |
| 100 | + * http://caniuse.com/#search=transition |
| 101 | + */ |
| 102 | + .noUi-target[disabled] .noUi-base { |
117 | 103 | background: #999; |
118 | | - cursor: not-allowed; |
119 | | - border-color: #333; |
120 | 104 | } |
121 | | - .noUi-root:disabled { |
122 | | - display: none; |
| 105 | + .noUi-target[disabled] .noUi-connect { |
| 106 | + background: #BBB; |
| 107 | + } |
| 108 | + .noUi-state-tap .noUi-origin { |
| 109 | + -webkit-transition: left 0.3s, top 0.3s; |
| 110 | + transition: left 0.3s, top 0.3s; |
123 | 111 | } |
0 commit comments