UNPKG

6.27 kBSCSSView Raw
1@import "../../themes/ionic.globals.wp";
2
3// Windows Range
4// --------------------------------------------------
5
6/// @prop - Padding top/bottom of the range
7$range-wp-padding-vertical: 8px !default;
8
9/// @prop - Padding start/end of the range
10$range-wp-padding-horizontal: 8px !default;
11
12/// @prop - Height of the range slider
13$range-wp-slider-height: 42px !default;
14
15/// @prop - Width of the area that will select the range knob
16$range-wp-hit-width: 42px !default;
17
18/// @prop - Height of the area that will select the range knob
19$range-wp-hit-height: $range-wp-slider-height !default;
20
21/// @prop - Height of the range bar
22$range-wp-bar-height: 2px !default;
23
24/// @prop - Background of the range bar
25$range-wp-bar-background-color: #bdbdbd !default;
26
27/// @prop - Background of the active range bar
28$range-wp-bar-active-background-color: color($colors-wp, primary) !default;
29
30/// @prop - Width of the range knob
31$range-wp-knob-width: 8px !default;
32
33/// @prop - Height of the range knob
34$range-wp-knob-height: $range-wp-knob-width * 3 !default;
35
36/// @prop - Background of the range knob
37$range-wp-knob-background-color: $range-wp-bar-active-background-color !default;
38
39/// @prop - Border radius of the range knob
40$range-wp-knob-border-radius: $range-wp-knob-width / 2 !default;
41
42/// @prop - Width of the range tick
43$range-wp-tick-width: $range-wp-bar-height !default;
44
45/// @prop - Height of the range tick
46$range-wp-tick-height: $range-wp-tick-width * 3 !default;
47
48/// @prop - Border radius of the range tick
49$range-wp-tick-border-radius: $range-wp-knob-width / 2 !default;
50
51/// @prop - Background of the range tick
52$range-wp-tick-background-color: $range-wp-bar-background-color !default;
53
54/// @prop - Background of the active range tick
55$range-wp-tick-active-background-color: $range-wp-bar-active-background-color !default;
56
57/// @prop - Background of the range pin
58$range-wp-pin-background-color: $range-wp-bar-active-background-color !default;
59
60/// @prop - Color of the range pin
61$range-wp-pin-color: color-contrast($colors-wp, $range-wp-bar-active-background-color) !default;
62
63/// @prop - Font size of the range pin
64$range-wp-pin-font-size: 12px !default;
65
66// deprecated
67$range-wp-pin-padding: null !default;
68
69/// @prop - Padding top of the range pin
70$range-wp-pin-padding-top: 8px !default;
71
72/// @prop - Padding end of the range pin
73$range-wp-pin-padding-end: $range-wp-pin-padding-top !default;
74
75/// @prop - Padding bottom of the range pin
76$range-wp-pin-padding-bottom: $range-wp-pin-padding-top !default;
77
78/// @prop - Padding start of the range pin
79$range-wp-pin-padding-start: $range-wp-pin-padding-end !default;
80
81
82.range-wp {
83 @include padding($range-wp-padding-vertical, $range-wp-padding-horizontal);
84}
85
86.range-wp [range-left] {
87 @include margin(0, 12px, 0, 0);
88}
89
90.range-wp [range-right] {
91 @include margin(0, 0, 0, 12px);
92}
93
94.range-wp.range-has-pin {
95 @include padding($range-wp-padding-vertical + $range-wp-pin-font-size + $range-wp-pin-padding-top, null, null, null);
96}
97
98.range-wp .range-slider {
99 height: $range-wp-slider-height;
100}
101
102.range-wp .range-bar {
103 @include position(($range-wp-slider-height / 2), null, null, 0);
104
105 position: absolute;
106
107 width: 100%;
108 height: $range-wp-bar-height;
109
110 background: $range-wp-bar-background-color;
111
112 pointer-events: none;
113}
114
115.range-wp.range-pressed .range-bar-active {
116 will-change: left, right;
117}
118
119.range-wp.range-pressed .range-knob-handle {
120 will-change: left;
121}
122
123.range-wp .range-bar-active {
124 bottom: 0;
125
126 width: auto;
127
128 background: $range-wp-bar-active-background-color;
129}
130
131.range-wp .range-knob-handle {
132 @include position(($range-wp-slider-height / 2), null, null, 0);
133 @include margin(-($range-wp-hit-height / 2), null, null, -($range-wp-hit-width / 2));
134 @include text-align(center);
135
136 position: absolute;
137
138 width: $range-wp-hit-width;
139 height: $range-wp-hit-height;
140}
141
142.range-wp .range-knob {
143 @include position(($range-wp-hit-height / 2) - ($range-wp-knob-height / 2) + ($range-wp-bar-height / 2),
144 null, null, ($range-wp-hit-width / 2) - ($range-wp-knob-width / 2));
145 @include border-radius($range-wp-knob-border-radius);
146
147 position: absolute;
148
149 width: $range-wp-knob-width;
150 height: $range-wp-knob-height;
151
152 background: $range-wp-knob-background-color;
153
154 pointer-events: none;
155}
156
157.range-wp .range-tick {
158 @include margin-horizontal(-($range-wp-tick-width / 2), null);
159 @include border-radius($range-wp-tick-border-radius);
160
161 position: absolute;
162 top: ($range-wp-hit-height / 2) - ($range-wp-tick-height / 2) + ($range-wp-bar-height / 2);
163
164 width: $range-wp-tick-width;
165 height: $range-wp-tick-height;
166
167 background: $range-wp-tick-background-color;
168
169 pointer-events: none;
170}
171
172.range-wp .range-tick-active {
173 background: $range-wp-tick-active-background-color;
174}
175
176.range-wp .range-pin {
177 @include text-align(center);
178 @include border-radius(50px);
179 @include transform(translate3d(0, 28px, 0), scale(.01));
180
181 position: relative;
182 top: -24px;
183 display: inline-block;
184
185 min-width: 28px;
186
187 font-size: $range-wp-pin-font-size;
188
189 color: $range-wp-pin-color;
190
191 background: $range-wp-pin-background-color;
192
193 transition: transform 120ms ease;
194
195 @include deprecated-variable(padding, $range-wp-pin-padding) {
196 @include padding($range-wp-pin-padding-top, $range-wp-pin-padding-end, $range-wp-pin-padding-bottom, $range-wp-pin-padding-start);
197 }
198}
199
200.range-wp .range-knob-pressed .range-pin {
201 @include transform(translate3d(0, 0, 0), scale(1));
202}
203
204.range-wp.range-disabled {
205 opacity: .5;
206}
207
208// Generate Windows Range Colors
209// --------------------------------------------------
210
211@each $color-name, $color-base, $color-contrast in get-colors($colors-wp) {
212
213 .range-wp-#{$color-name} {
214 .range-bar-active,
215 .range-tick-active,
216 .range-knob,
217 .range-pin {
218 background: $color-base;
219 }
220 }
221
222}