|
1 |
| -/* stylelint-disable */ |
| 1 | + |
2 | 2 | @mixin thumb {
|
3 |
| - background-color: transparent; |
| 3 | + background: $white; |
4 | 4 | background-position: 0 0;
|
5 | 5 | box-sizing: content-box;
|
6 | 6 | width: 12px;
|
|
13 | 13 | cursor: pointer;
|
14 | 14 | z-index: 20;
|
15 | 15 | pointer-events: auto;
|
16 |
| - background: $white; |
17 |
| - transition: transform .2s ease-in-out; |
| 16 | + transition: transform 0.2s ease-in-out; |
18 | 17 | -webkit-appearance: none;
|
19 | 18 | -moz-appearance: none;
|
20 | 19 | appearance: none;
|
21 |
| - |
22 | 20 | &:hover {
|
23 | 21 | @include thumbFocus;
|
24 | 22 | }
|
25 | 23 | }
|
26 | 24 |
|
27 | 25 | @mixin thumbFocus {
|
28 | 26 | background: $gray-900;
|
| 27 | + border-color: $white; |
29 | 28 | }
|
30 | 29 |
|
31 |
| -/* stylelint-enable */ |
| 30 | + |
32 | 31 | @mixin track {
|
33 | 32 | cursor: default;
|
34 |
| - height: 1px; /* Required for Samsung internet based browsers */ |
| 33 | + height: 1px; |
| 34 | + /* Required for Samsung internet based browsers */ |
35 | 35 | outline: 0;
|
36 | 36 | -webkit-appearance: none;
|
37 | 37 | -moz-appearance: none;
|
|
54 | 54 |
|
55 | 55 | .wc-block-components-price-slider {
|
56 | 56 | margin-bottom: $gap-large;
|
57 |
| - |
58 | 57 | &.is-loading.is-disabled {
|
59 | 58 | .wc-block-components-price-slider__range-input-wrapper,
|
60 | 59 | .wc-block-components-filter-reset-button,
|
61 | 60 | .wc-block-components-filter-submit-button {
|
62 | 61 | @include placeholder();
|
63 | 62 | box-shadow: none;
|
64 | 63 | }
|
65 |
| - |
66 | 64 | .wc-block-components-price-slider__amount {
|
67 | 65 | display: none;
|
68 | 66 | }
|
69 | 67 | }
|
70 |
| - |
71 | 68 | &.is-disabled:not(.is-loading) {
|
72 | 69 | .wc-block-components-price-slider__range-input-wrapper,
|
73 | 70 | .wc-block-components-price-slider__amount,
|
|
79 | 76 |
|
80 | 77 | .wc-block-components-price-slider__range-input-wrapper {
|
81 | 78 | @include reset;
|
82 |
| - background: $gray-300; |
| 79 | + background: transparent; |
83 | 80 | border-radius: 4px;
|
84 | 81 | clear: both;
|
85 | 82 | flex-grow: 1;
|
86 | 83 | height: 4px;
|
87 | 84 | margin: 15px 0;
|
88 | 85 | position: relative;
|
89 | 86 |
|
| 87 | + &::before { |
| 88 | + content: ""; |
| 89 | + position: absolute; |
| 90 | + top: 0; |
| 91 | + right: 0; |
| 92 | + left: 0; |
| 93 | + bottom: 0; |
| 94 | + background: currentColor; |
| 95 | + opacity: 0.2; |
| 96 | + } |
| 97 | + |
90 | 98 | &.is-loading {
|
91 | 99 | @include placeholder();
|
92 | 100 | height: em(9px);
|
|
101 | 109 | top: 0;
|
102 | 110 | width: 100%;
|
103 | 111 | --track-background: linear-gradient(to right, transparent var(--low), var(--range-color) 0, var(--range-color) var(--high), transparent 0) no-repeat 0 100% / 100% 100%;
|
104 |
| - --range-color: #{$gray-900}; |
| 112 | + --range-color: currentColor; |
105 | 113 | /*rtl:ignore*/
|
106 | 114 | background: var(--track-background);
|
107 | 115 | }
|
|
112 | 120 | gap: $gap-smaller;
|
113 | 121 | justify-content: space-between;
|
114 | 122 | margin: $gap 0;
|
115 |
| - |
116 | 123 | .wc-block-components-price-slider__amount {
|
117 | 124 | margin: 0;
|
118 | 125 | border-radius: 4px;
|
|
121 | 128 | max-width: 80px;
|
122 | 129 | min-width: 0;
|
123 | 130 | padding: $gap-smaller;
|
124 |
| - |
125 | 131 | .wc-block-components-price-slider--is-input-inline & {
|
126 | 132 | max-width: 60px;
|
127 | 133 | }
|
128 |
| - |
129 | 134 | &.is-loading {
|
130 | 135 | @include placeholder();
|
131 | 136 | border-radius: 0 !important;
|
|
146 | 151 | display: flex;
|
147 | 152 | gap: $gap;
|
148 | 153 | justify-content: flex-end;
|
149 |
| - |
150 | 154 | // The specificity here is needed to overwrite the margin-top that is inherited on WC block template pages such as Shop.
|
151 | 155 | button[type="submit"]:not(.wp-block-search__button).wc-block-components-filter-submit-button {
|
152 | 156 | margin-top: 0;
|
|
165 | 169 | position: absolute;
|
166 | 170 | left: 0;
|
167 | 171 | top: 0;
|
168 |
| - |
169 | 172 | &::-webkit-slider-runnable-track {
|
170 | 173 | @include track;
|
171 | 174 | }
|
172 |
| - |
173 | 175 | &::-webkit-slider-thumb {
|
174 | 176 | @include thumb;
|
175 | 177 | margin: -5px 0 0 0;
|
176 | 178 | }
|
177 |
| - |
178 | 179 | &::-webkit-slider-progress {
|
179 | 180 | @include reset;
|
180 | 181 | }
|
181 |
| - |
182 | 182 | &::-moz-focus-outer {
|
183 | 183 | border: 0;
|
184 | 184 | }
|
185 |
| - |
186 | 185 | &::-moz-range-track {
|
187 | 186 | @include track;
|
188 | 187 | }
|
189 |
| - |
190 | 188 | &::-moz-range-progress {
|
191 | 189 | @include reset;
|
192 | 190 | }
|
193 |
| - |
194 | 191 | &::-moz-range-thumb {
|
195 | 192 | @include thumb;
|
196 | 193 | }
|
197 |
| - |
198 | 194 | &::-ms-thumb {
|
199 | 195 | @include thumb;
|
200 | 196 | }
|
201 |
| - |
202 | 197 | &:focus {
|
203 | 198 | &::-webkit-slider-thumb {
|
204 | 199 | @include thumbFocus;
|
205 | 200 | }
|
206 |
| - |
207 | 201 | &::-moz-range-thumb {
|
208 | 202 | @include thumbFocus;
|
209 | 203 | }
|
210 |
| - |
211 | 204 | &::-ms-thumb {
|
212 | 205 | @include thumbFocus;
|
213 | 206 | }
|
214 | 207 | }
|
215 |
| - |
216 | 208 | &.wc-block-components-price-slider__range-input--min {
|
217 | 209 | z-index: 21;
|
218 |
| - |
219 | 210 | &::-webkit-slider-thumb {
|
220 | 211 | margin-left: -2px;
|
221 | 212 | background-position-x: left;
|
222 | 213 | }
|
223 |
| - |
224 | 214 | &::-moz-range-thumb {
|
225 | 215 | background-position-x: left;
|
226 | 216 | transform: translate(-2px, 2px);
|
227 | 217 | }
|
228 |
| - |
229 | 218 | &::-ms-thumb {
|
230 | 219 | background-position-x: left;
|
231 | 220 | }
|
232 | 221 | }
|
233 |
| - |
234 | 222 | &.wc-block-components-price-slider__range-input--max {
|
235 | 223 | z-index: 20;
|
236 |
| - |
237 | 224 | &::-webkit-slider-thumb {
|
238 | 225 | background-position-x: right;
|
239 | 226 | margin-left: 2px;
|
240 | 227 | }
|
241 |
| - |
242 | 228 | &::-moz-range-thumb {
|
243 | 229 | background-position-x: right;
|
244 | 230 | transform: translate(2px, 2px);
|
245 | 231 | }
|
246 |
| - |
247 | 232 | &::-ms-thumb {
|
248 | 233 | background-position-x: right;
|
249 | 234 | }
|
|
272 | 257 | .wc-block-components-price-slider__range-input {
|
273 | 258 | height: 24px;
|
274 | 259 | pointer-events: auto;
|
275 |
| - |
276 | 260 | &::-ms-track {
|
277 | 261 | /*remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead */
|
278 | 262 | background: transparent;
|
279 |
| - |
280 | 263 | /*leave room for the larger thumb to overflow with a transparent border */
|
281 | 264 | border-color: transparent;
|
282 | 265 | border-width: 7px 0;
|
283 |
| - |
284 | 266 | /*remove default tick marks*/
|
285 | 267 | color: transparent;
|
286 | 268 | }
|
287 |
| - |
288 | 269 | &::-ms-fill-lower {
|
289 | 270 | background: #e1e1e1;
|
290 | 271 | box-shadow: 0 0 0 1px inset #b8b8b8;
|
291 | 272 | }
|
292 |
| - |
293 | 273 | &::-ms-fill-upper {
|
294 | 274 | background: transparent;
|
295 | 275 | }
|
296 |
| - |
297 | 276 | &::-ms-tooltip {
|
298 | 277 | display: none;
|
299 | 278 | }
|
300 |
| - |
301 | 279 | &::-ms-thumb {
|
302 | 280 | transform: translate(1px, 0);
|
303 | 281 | pointer-events: auto;
|
|
308 | 286 | background: #e1e1e1;
|
309 | 287 | box-shadow: 0 0 0 1px inset #b8b8b8;
|
310 | 288 | }
|
311 |
| - |
312 | 289 | &::-ms-fill-lower {
|
313 | 290 | background: transparent;
|
314 | 291 | }
|
315 | 292 | }
|
316 |
| - |
317 | 293 | .wc-block-components-price-slider {
|
318 | 294 | &.is-loading.is-disabled {
|
319 | 295 | .wc-block-components-price-slider__range-input-wrapper {
|
320 | 296 | @include placeholder();
|
321 | 297 | box-shadow: none;
|
322 | 298 | }
|
323 | 299 | }
|
324 |
| - |
325 | 300 | &.is-disabled:not(.is-loading) {
|
326 | 301 | .wc-block-components-price-slider__range-input-wrapper {
|
327 | 302 | animation: none;
|
|
330 | 305 | }
|
331 | 306 | }
|
332 | 307 |
|
| 308 | + |
333 | 309 | /* IE 11 will not support multi-range slider due to poor pointer-events support on the thumb. Reverts to 2 sliders. */
|
| 310 | + |
334 | 311 | @include ie11() {
|
335 | 312 | @include ie-fixes();
|
336 | 313 | }
|
|
342 | 319 |
|
343 | 320 | .theme-twentytwentyone {
|
344 | 321 | $border-width: 3px;
|
345 |
| - |
346 | 322 | .wc-block-components-price-slider__range-input-wrapper {
|
347 | 323 | background: transparent;
|
348 | 324 | border: $border-width solid currentColor;
|
349 | 325 | box-sizing: border-box;
|
350 | 326 | }
|
351 |
| - |
352 | 327 | .wc-block-components-price-slider__range-input-progress {
|
353 | 328 | --range-color: currentColor;
|
354 | 329 | margin: -$border-width;
|
355 | 330 | }
|
356 |
| - |
357 | 331 | .wc-block-price-filter__range-input {
|
358 | 332 | background: transparent;
|
359 | 333 | margin: -$border-width;
|
360 | 334 | width: calc(100% + #{$border-width * 2});
|
361 |
| - |
362 | 335 | &:hover,
|
363 | 336 | &:focus {
|
364 | 337 | &::-webkit-slider-thumb {
|
365 | 338 | filter: none;
|
366 | 339 | }
|
367 |
| - |
368 | 340 | &::-moz-range-thumb {
|
369 | 341 | filter: none;
|
370 | 342 | }
|
371 |
| - |
372 | 343 | &::-ms-thumb {
|
373 | 344 | filter: none;
|
374 | 345 | }
|
375 | 346 | }
|
376 |
| - |
377 | 347 | &::-webkit-slider-thumb {
|
378 | 348 | margin-top: -9px;
|
379 | 349 | }
|
380 |
| - |
381 | 350 | &.wc-block-components-price-slider__range-input--max::-moz-range-thumb {
|
382 | 351 | transform: translate(2px, 1px);
|
383 | 352 | }
|
384 |
| - |
385 | 353 | &.wc-block-components-price-slider__range-input--min::-moz-range-thumb {
|
386 | 354 | transform: translate(-2px, 1px);
|
387 | 355 | }
|
388 |
| - |
389 | 356 | &::-ms-track {
|
390 | 357 | border-color: transparent !important;
|
391 | 358 | }
|
392 | 359 | }
|
393 |
| - |
394 | 360 | @include ie11() {
|
395 | 361 | .wc-block-components-price-slider__range-input-wrapper {
|
396 | 362 | border: 0;
|
397 | 363 | height: auto;
|
398 | 364 | position: relative;
|
399 | 365 | height: 50px;
|
400 | 366 | }
|
401 |
| - |
402 | 367 | .wc-block-components-price-slider__range-input-progress {
|
403 | 368 | display: none;
|
404 | 369 | }
|
405 |
| - |
406 | 370 | .wc-block-price-filter__range-input {
|
407 | 371 | height: 100%;
|
408 | 372 | margin: 0;
|
|
0 commit comments