|
1 | 1 | @use "../../themes/ionic/ionic.globals.scss" as globals; |
2 | 2 | @import "./range.common"; |
3 | | -@import "../../foundations/ionic.vars"; |
4 | 3 |
|
5 | 4 | // Ionic Range |
6 | 5 | // -------------------------------------------------- |
7 | 6 |
|
8 | 7 | :host { |
9 | 8 | --knob-border-radius: 50%; |
10 | | - --knob-background: #{$ion-primitives-base-white}; |
| 9 | + --knob-background: #{globals.$ion-primitives-base-white}; |
11 | 10 | --knob-box-shadow: 0; |
12 | 11 | --knob-size: 22px; |
13 | | - --knob-handle-size: #{$ion-scale-1000}; |
14 | | - --bar-height: #{$ion-scale-200}; |
15 | | - --bar-background: #{$ion-primitives-neutral-100}; |
| 12 | + --knob-handle-size: #{globals.$ion-scale-1000}; |
| 13 | + --bar-height: #{globals.$ion-scale-200}; |
| 14 | + --bar-background: #{globals.$ion-primitives-neutral-100}; |
16 | 15 | --bar-background-active: #{ion-color(primary, base)}; |
17 | | - --bar-border-radius: #{$ion-border-radius-400}; |
| 16 | + --bar-border-radius: #{globals.$ion-border-radius-400}; |
18 | 17 | --height: 42px; |
19 | 18 |
|
20 | 19 | @include globals.typography(globals.$ion-body-md-regular); |
21 | 20 |
|
22 | | - z-index: $ion-z-index-100; |
| 21 | + z-index: globals.$ion-z-index-100; |
23 | 22 | } |
24 | 23 |
|
25 | 24 | :host(.range-item-start-adjustment) { |
26 | | - @include padding(null, null, null, $ion-space-600); |
| 25 | + @include padding(null, null, null, globals.$ion-space-600); |
27 | 26 | } |
28 | 27 |
|
29 | 28 | :host(.range-item-end-adjustment) { |
30 | | - @include padding(null, $ion-space-600, null, null); |
| 29 | + @include padding(null, globals.$ion-space-600, null, null); |
31 | 30 | } |
32 | 31 |
|
33 | 32 | :host(.ion-color) .range-bar-active, |
|
36 | 35 | } |
37 | 36 |
|
38 | 37 | ::slotted(ion-icon[slot]) { |
39 | | - font-size: $ion-font-size-600; |
| 38 | + font-size: globals.$ion-font-size-600; |
40 | 39 | } |
41 | 40 |
|
42 | 41 | ::slotted([slot="start"]) { |
|
48 | 47 | } |
49 | 48 |
|
50 | 49 | ::slotted([slot="label"]) { |
51 | | - max-width: $ion-scale-5000; |
| 50 | + max-width: globals.$ion-scale-5000; |
52 | 51 | } |
53 | 52 |
|
54 | 53 | :host(.range-has-pin:not(.range-label-placement-stacked)) { |
|
64 | 63 | * overlapping the range. The buffer is added to the |
65 | 64 | * bottom of the range label instead of the host. |
66 | 65 | */ |
67 | | - @include padding(calc($ion-space-200 + dynamic-font(12px)), null, null, null); |
| 66 | + @include padding(calc(#{globals.$ion-space-200} + dynamic-font(12px)), null, null, null); |
68 | 67 | } |
69 | 68 |
|
70 | 69 | :host(.range-has-pin.range-label-placement-stacked) .label-text-wrapper { |
|
73 | 72 | * margin to the bottom of the label, it provides a buffer |
74 | 73 | * for the pin to move into when it is pressed. |
75 | 74 | */ |
76 | | - @include margin(null, null, calc($ion-space-200 + dynamic-font(12px)), null); |
| 75 | + @include margin(null, null, calc(#{globals.$ion-space-200} + dynamic-font(12px)), null); |
77 | 76 | } |
78 | 77 |
|
79 | 78 | .range-bar-active { |
|
85 | 84 |
|
86 | 85 | &.has-ticks { |
87 | 86 | @include border-radius(0); |
88 | | - @include margin(null, calc(-1 * $ion-scale-100 * 0.5), null, calc(-1 * $ion-scale-100 * 0.5)); |
| 87 | + @include margin(null, calc(-1 * #{globals.$ion-scale-100} * 0.5), null, calc(-1 * #{globals.$ion-scale-100} * 0.5)); |
89 | 88 | } |
90 | 89 | } |
91 | 90 |
|
92 | 91 | .range-tick { |
93 | | - @include margin-horizontal(calc($ion-scale-100 * -0.5), null); |
94 | | - @include border-radius($ion-border-radius-0); |
| 92 | + @include margin-horizontal(calc(#{globals.$ion-scale-100} * -0.5), null); |
| 93 | + @include border-radius(globals.$ion-border-radius-0); |
95 | 94 |
|
96 | 95 | position: absolute; |
97 | | - top: calc((42px * 0.5) - ($ion-scale-300 * 0.5)); |
| 96 | + top: calc((42px * 0.5) - (#{globals.$ion-scale-300} * 0.5)); |
98 | 97 |
|
99 | | - width: $ion-scale-100; |
100 | | - height: $ion-scale-300; |
| 98 | + width: globals.$ion-scale-100; |
| 99 | + height: globals.$ion-scale-300; |
101 | 100 |
|
102 | | - background: $ion-primitives-neutral-100; |
| 101 | + background: globals.$ion-primitives-neutral-100; |
103 | 102 | pointer-events: none; |
104 | 103 | } |
105 | 104 |
|
|
109 | 108 |
|
110 | 109 | .range-pin { |
111 | 110 | @include transform(translate3d(0, 100%, 0), scale(0.01)); |
112 | | - @include padding($ion-space-200, $ion-space-200, $ion-space-200, $ion-space-200); |
| 111 | + @include padding(globals.$ion-space-200, globals.$ion-space-200, globals.$ion-space-200, globals.$ion-space-200); |
113 | 112 |
|
114 | 113 | min-width: 28px; |
115 | 114 |
|
116 | 115 | transition: transform 120ms ease; |
117 | 116 |
|
118 | 117 | background: transparent; |
119 | | - color: $text-color; |
120 | 118 |
|
121 | 119 | font-size: dynamic-font(12px); |
122 | 120 |
|
123 | 121 | text-align: center; |
124 | 122 | } |
125 | 123 |
|
126 | 124 | .range-knob { |
127 | | - border-width: $ion-border-size-025; |
| 125 | + border-width: globals.$ion-border-size-025; |
128 | 126 | border-style: solid; |
129 | 127 | border-color: #{ion-color(primary, base)}; |
130 | 128 | } |
|
162 | 160 | * the range should be on the end |
163 | 161 | * when the label sits at the start. |
164 | 162 | */ |
165 | | - @include margin(0, $ion-space-400, 0, 0); |
| 163 | + @include margin(0, globals.$ion-space-400, 0, 0); |
166 | 164 | } |
167 | 165 |
|
168 | 166 | // Range Label Placement - End |
|
174 | 172 | * the range should be on the start |
175 | 173 | * when the label sits at the end. |
176 | 174 | */ |
177 | | - @include margin(0, 0, 0, $ion-space-400); |
| 175 | + @include margin(0, 0, 0, globals.$ion-space-400); |
178 | 176 | } |
179 | 177 |
|
180 | 178 | // Range Label Placement - Fixed |
|
186 | 184 | * the range should be on the end |
187 | 185 | * when the label sits at the start. |
188 | 186 | */ |
189 | | - @include margin(0, $ion-space-400, 0, 0); |
| 187 | + @include margin(0, globals.$ion-space-400, 0, 0); |
190 | 188 | } |
191 | 189 |
|
192 | 190 | // Range Label Placement - Stacked |
193 | 191 | // ---------------------------------------------------------------- |
194 | 192 |
|
195 | 193 | :host(.range-label-placement-stacked) .label-text-wrapper { |
| 194 | + @include transform(scale(0.75)); |
| 195 | + |
196 | 196 | /** |
197 | 197 | * The margin between the label and |
198 | 198 | * the range should be on the bottom |
199 | 199 | * when the label sits on top. |
200 | 200 | */ |
201 | | - @include margin(null, 0, $ion-space-400, 0); |
| 201 | + @include margin(null, 0, globals.$ion-space-400, 0); |
| 202 | + |
| 203 | + /** |
| 204 | + * Label text should not extend |
| 205 | + * beyond the bounds of the range. |
| 206 | + */ |
| 207 | + max-width: calc(100% / 0.75); |
202 | 208 | } |
203 | 209 |
|
204 | 210 | :host(.in-item.range-label-placement-stacked) .label-text-wrapper { |
205 | | - @include margin($ion-space-250, null, $ion-space-400, null); |
| 211 | + @include margin(globals.$ion-space-250, null, globals.$ion-space-400, null); |
206 | 212 | } |
207 | 213 |
|
208 | 214 | :host(.in-item.range-label-placement-stacked) .native-wrapper { |
209 | | - @include margin(null, null, $ion-space-0, null); |
| 215 | + @include margin(null, null, globals.$ion-space-0, null); |
210 | 216 | } |
0 commit comments