|
26 | 26 | $mat-slider-disabled-color: mat-color($foreground, slider-off);
|
27 | 27 | $mat-slider-labeled-min-value-thumb-color: mat-color($foreground, slider-min);
|
28 | 28 | $mat-slider-labeled-min-value-thumb-label-color: mat-color($foreground, slider-off);
|
29 |
| - $mat-slider-focus-ring-color: mat-color($accent, default, 0.2); |
30 |
| - $mat-slider-focus-ring-min-value-color: mat-color($foreground, base, 0.12); |
31 |
| - $mat-slider-tick-color: mat-color($foreground, base, 0.7); |
| 29 | + $mat-slider-tick-opacity: 0.7; |
| 30 | + $mat-slider-tick-color: mat-color($foreground, base, $mat-slider-tick-opacity); |
32 | 31 | $mat-slider-tick-size: 2px;
|
33 | 32 |
|
34 | 33 | .mat-slider-track-background {
|
|
48 | 47 | }
|
49 | 48 |
|
50 | 49 | .mat-slider-focus-ring {
|
51 |
| - background-color: $mat-slider-focus-ring-color; |
| 50 | + $opacity: 0.2; |
| 51 | + $color: mat-color($accent, default, $opacity); |
| 52 | + background-color: $color; |
| 53 | + |
| 54 | + // `mat-color` uses `rgba` for the opacity which won't work with |
| 55 | + // CSS variables so we need to use `opacity` as a fallback. |
| 56 | + @if (type-of($color) != color) { |
| 57 | + opacity: $opacity; |
| 58 | + } |
52 | 59 | }
|
53 | 60 |
|
54 | 61 | .mat-slider:hover,
|
|
74 | 81 |
|
75 | 82 | .mat-slider-min-value {
|
76 | 83 | .mat-slider-focus-ring {
|
77 |
| - background-color: $mat-slider-focus-ring-min-value-color; |
| 84 | + $opacity: 0.12; |
| 85 | + $color: mat-color($foreground, base, $opacity); |
| 86 | + background-color: $color; |
| 87 | + |
| 88 | + // `mat-color` uses `rgba` for the opacity which won't work with |
| 89 | + // CSS variables so we need to use `opacity` as a fallback. |
| 90 | + @if (type-of($color) != color) { |
| 91 | + opacity: $opacity; |
| 92 | + } |
78 | 93 | }
|
79 | 94 |
|
80 | 95 | &.mat-slider-thumb-label-showing {
|
|
112 | 127 |
|
113 | 128 | .mat-slider-has-ticks .mat-slider-wrapper::after {
|
114 | 129 | border-color: $mat-slider-tick-color;
|
| 130 | + |
| 131 | + // `mat-color` uses `rgba` for the opacity which won't work with |
| 132 | + // CSS variables so we need to use `opacity` as a fallback. |
| 133 | + @if (type-of($mat-slider-tick-color) != color) { |
| 134 | + opacity: $mat-slider-tick-opacity; |
| 135 | + } |
115 | 136 | }
|
116 | 137 |
|
117 | 138 | .mat-slider-horizontal .mat-slider-ticks {
|
|
121 | 142 | // (see https://bugzilla.mozilla.org/show_bug.cgi?id=1314319).
|
122 | 143 | background-image: -moz-repeating-linear-gradient(0.0001deg, $mat-slider-tick-color,
|
123 | 144 | $mat-slider-tick-color $mat-slider-tick-size, transparent 0, transparent);
|
| 145 | + |
| 146 | + // `mat-color` uses `rgba` for the opacity which won't work with |
| 147 | + // CSS variables so we need to use `opacity` as a fallback. |
| 148 | + @if (type-of($mat-slider-tick-color) != color) { |
| 149 | + opacity: $mat-slider-tick-opacity; |
| 150 | + } |
124 | 151 | }
|
125 | 152 |
|
126 | 153 | .mat-slider-vertical .mat-slider-ticks {
|
127 | 154 | background-image: repeating-linear-gradient(to bottom, $mat-slider-tick-color,
|
128 | 155 | $mat-slider-tick-color $mat-slider-tick-size, transparent 0, transparent);
|
| 156 | + |
| 157 | + // `mat-color` uses `rgba` for the opacity which won't work with |
| 158 | + // CSS variables so we need to use `opacity` as a fallback. |
| 159 | + @if (type-of($mat-slider-tick-color) != color) { |
| 160 | + opacity: $mat-slider-tick-opacity; |
| 161 | + } |
129 | 162 | }
|
130 | 163 | }
|
131 | 164 |
|
|
0 commit comments