OLD | NEW |
---|---|
(Empty) | |
1 /* Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
2 * Use of this source code is governed by a BSD-style license that can be | |
3 * found in the LICENSE file. | |
4 */ | |
5 | |
6 /* Customize the standard input[type='range']. */ | |
7 .slider > input[type='range'] { | |
8 -webkit-appearance: none !important; /* Hide the default thumb icon. */ | |
9 background: transparent; /* Hide the standard slider bar */ | |
10 height: 100%; | |
11 left: -2px; /* Required to align the input element with the parent. */ | |
12 position: absolute; | |
13 top: -2px; | |
14 width: 100%; | |
15 } | |
16 | |
17 /* Custom thumb icon. */ | |
18 .slider > input[type='range']::-webkit-slider-thumb { | |
19 -webkit-appearance: none; | |
20 background-position: center center; | |
21 background-repeat: no-repeat; | |
22 height: 24px; | |
23 position: relative; | |
24 z-index: 2; | |
25 } | |
26 | |
27 /* Custom slider bar (we hide the standard one). */ | |
28 .slider > .bar { | |
29 /* In order to match the horizontal position of the standard slider bar | |
30 left and right must be equal to 1/2 of the thumb icon width. */ | |
31 left: 8px; | |
32 right: 8px; | |
33 bottom: 10px; | |
34 pointer-events: none; /* Mouse events pass through to the standard input. */ | |
35 position: absolute; | |
36 top: 10px; | |
37 background-image: -webkit-image-set( | |
38 url('../images/slider/slide_bar_center.png') 1x); | |
yoshiki
2013/08/28 08:58:44
(1) -webkit-image-set is not necessary if we don't
falken
2013/08/29 09:35:44
Done.
| |
39 height: 4px; | |
40 } | |
41 | |
42 .slider > .bar > .filled, | |
43 .slider > .bar > .cap { | |
44 position: absolute; | |
45 } | |
46 | |
47 /* The filled portion of the slider bar to the left of the thumb. */ | |
48 .slider > .bar > .filled { | |
49 border-left-style: none; | |
50 border-right-style: none; | |
51 left: 0; | |
52 width: 0; /* The element style.width is manipulated from the code. */ | |
53 } | |
54 | |
55 .slider > .bar > .cap.right { | |
56 background-image: -webkit-image-set( | |
57 url('../images/slider/slider_bar_right.png') 1x); | |
58 height: 4px; | |
59 width: 4px; | |
60 left: 100%; | |
61 } | |
62 | |
63 .slider > .bar > .filled { | |
64 background-image: -webkit-image-set( | |
65 url('../images/slider/slide_bar_fill_center.png') 1x); | |
66 height: 4px; | |
67 } | |
68 | |
69 .slider > .bar > .cap.left { | |
70 background-image: -webkit-image-set( | |
71 url('../images/slider/slide_bar_fill_left.png') 1x); | |
72 height: 4px; | |
73 width: 4px; | |
74 right: 100%; | |
75 } | |
76 | |
77 .slider.disabled > .bar { | |
78 background-image: -webkit-image-set( | |
79 url('../images/slider/slide_bar_disabled_center.png') 1x); | |
80 } | |
81 | |
82 .slider.disabled > .bar > .filled { | |
83 background-image: -webkit-image-set( | |
84 url('../images/slider/slide_bar_disabled_center.png') 1x); | |
85 } | |
86 | |
87 .slider.disabled > .bar > .cap.left { | |
88 background-image: -webkit-image-set( | |
89 url('../images/slider/slide_bar_disabled_left.png') 1x); | |
90 } | |
91 | |
92 .slider.disabled > .bar > .cap.right { | |
93 background-image: -webkit-image-set( | |
94 url('../images/slider/slide_bar_disabled_right.png') 1x); | |
95 } | |
96 | |
97 .slider.disabled, | |
98 .slider.readonly { | |
99 pointer-events: none; | |
100 } | |
yoshiki
2013/08/28 08:58:44
Add a blank line.
falken
2013/08/29 09:35:44
Done.
| |
101 .slider { | |
102 -webkit-box-flex: 1; | |
103 } | |
104 | |
105 .slider > input[type='range']::-webkit-slider-thumb { | |
106 background-image: -webkit-image-set( | |
107 url('../images/slider/slider_thumb.png') 1x); | |
108 width: 16px; | |
109 } | |
110 | |
111 .slider > input[type='range']::-webkit-slider-thumb:hover { | |
112 background-image: -webkit-image-set( | |
113 url('../images/slider/slider_thumb_hover.png') 1x); | |
114 } | |
115 | |
116 .slider > input[type='range']::-webkit-slider-thumb:active { | |
117 background-image: -webkit-image-set( | |
118 url('../images/slider/slider_thumb_down.png') 1x); | |
119 } | |
120 | |
121 .slider.disabled > input[type='range']::-webkit-slider-thumb { | |
122 background-image: -webkit-image-set( | |
123 url('../images/slider/slider_thumb_disabled.png') 1x); | |
124 } | |
OLD | NEW |