Skip to content

Commit e55f83d

Browse files
CR
1 parent 5300f3b commit e55f83d

File tree

3 files changed

+46
-37
lines changed

3 files changed

+46
-37
lines changed

core/src/components/range/range.common.scss

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
@import "../../themes/native/native.globals";
1+
@import "../../themes/mixins";
2+
@import "../../themes/functions.string";
23
@import "./range.vars.scss";
34

45
// Range
@@ -284,11 +285,4 @@
284285

285286
:host(.range-label-placement-stacked) .label-text-wrapper {
286287
@include transform-origin(start, top);
287-
@include transform(scale(#{$form-control-label-stacked-scale}));
288-
289-
/**
290-
* Label text should not extend
291-
* beyond the bounds of the range.
292-
*/
293-
max-width: calc(100% / #{$form-control-label-stacked-scale});
294288
}

core/src/components/range/range.ionic.scss

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,32 @@
11
@use "../../themes/ionic/ionic.globals.scss" as globals;
22
@import "./range.common";
3-
@import "../../foundations/ionic.vars";
43

54
// Ionic Range
65
// --------------------------------------------------
76

87
:host {
98
--knob-border-radius: 50%;
10-
--knob-background: #{$ion-primitives-base-white};
9+
--knob-background: #{globals.$ion-primitives-base-white};
1110
--knob-box-shadow: 0;
1211
--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};
1615
--bar-background-active: #{ion-color(primary, base)};
17-
--bar-border-radius: #{$ion-border-radius-400};
16+
--bar-border-radius: #{globals.$ion-border-radius-400};
1817
--height: 42px;
1918

2019
@include globals.typography(globals.$ion-body-md-regular);
2120

22-
z-index: $ion-z-index-100;
21+
z-index: globals.$ion-z-index-100;
2322
}
2423

2524
:host(.range-item-start-adjustment) {
26-
@include padding(null, null, null, $ion-space-600);
25+
@include padding(null, null, null, globals.$ion-space-600);
2726
}
2827

2928
:host(.range-item-end-adjustment) {
30-
@include padding(null, $ion-space-600, null, null);
29+
@include padding(null, globals.$ion-space-600, null, null);
3130
}
3231

3332
:host(.ion-color) .range-bar-active,
@@ -36,7 +35,7 @@
3635
}
3736

3837
::slotted(ion-icon[slot]) {
39-
font-size: $ion-font-size-600;
38+
font-size: globals.$ion-font-size-600;
4039
}
4140

4241
::slotted([slot="start"]) {
@@ -48,7 +47,7 @@
4847
}
4948

5049
::slotted([slot="label"]) {
51-
max-width: $ion-scale-5000;
50+
max-width: globals.$ion-scale-5000;
5251
}
5352

5453
:host(.range-has-pin:not(.range-label-placement-stacked)) {
@@ -64,7 +63,7 @@
6463
* overlapping the range. The buffer is added to the
6564
* bottom of the range label instead of the host.
6665
*/
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);
6867
}
6968

7069
:host(.range-has-pin.range-label-placement-stacked) .label-text-wrapper {
@@ -73,7 +72,7 @@
7372
* margin to the bottom of the label, it provides a buffer
7473
* for the pin to move into when it is pressed.
7574
*/
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);
7776
}
7877

7978
.range-bar-active {
@@ -85,21 +84,21 @@
8584

8685
&.has-ticks {
8786
@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));
8988
}
9089
}
9190

9291
.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);
9594

9695
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));
9897

99-
width: $ion-scale-100;
100-
height: $ion-scale-300;
98+
width: globals.$ion-scale-100;
99+
height: globals.$ion-scale-300;
101100

102-
background: $ion-primitives-neutral-100;
101+
background: globals.$ion-primitives-neutral-100;
103102
pointer-events: none;
104103
}
105104

@@ -109,22 +108,21 @@
109108

110109
.range-pin {
111110
@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);
113112

114113
min-width: 28px;
115114

116115
transition: transform 120ms ease;
117116

118117
background: transparent;
119-
color: $text-color;
120118

121119
font-size: dynamic-font(12px);
122120

123121
text-align: center;
124122
}
125123

126124
.range-knob {
127-
border-width: $ion-border-size-025;
125+
border-width: globals.$ion-border-size-025;
128126
border-style: solid;
129127
border-color: #{ion-color(primary, base)};
130128
}
@@ -162,7 +160,7 @@
162160
* the range should be on the end
163161
* when the label sits at the start.
164162
*/
165-
@include margin(0, $ion-space-400, 0, 0);
163+
@include margin(0, globals.$ion-space-400, 0, 0);
166164
}
167165

168166
// Range Label Placement - End
@@ -174,7 +172,7 @@
174172
* the range should be on the start
175173
* when the label sits at the end.
176174
*/
177-
@include margin(0, 0, 0, $ion-space-400);
175+
@include margin(0, 0, 0, globals.$ion-space-400);
178176
}
179177

180178
// Range Label Placement - Fixed
@@ -186,25 +184,33 @@
186184
* the range should be on the end
187185
* when the label sits at the start.
188186
*/
189-
@include margin(0, $ion-space-400, 0, 0);
187+
@include margin(0, globals.$ion-space-400, 0, 0);
190188
}
191189

192190
// Range Label Placement - Stacked
193191
// ----------------------------------------------------------------
194192

195193
:host(.range-label-placement-stacked) .label-text-wrapper {
194+
@include transform(scale(0.75));
195+
196196
/**
197197
* The margin between the label and
198198
* the range should be on the bottom
199199
* when the label sits on top.
200200
*/
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);
202208
}
203209

204210
: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);
206212
}
207213

208214
: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);
210216
}

core/src/components/range/range.native.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@import "range.common";
2+
@import "../../themes/native/native.globals";
23
@import "./range.vars.scss";
34

45
:host {
@@ -57,12 +58,20 @@
5758
// ----------------------------------------------------------------
5859

5960
:host(.range-label-placement-stacked) .label-text-wrapper {
61+
@include transform(scale(#{$form-control-label-stacked-scale}));
62+
6063
/**
6164
* The margin between the label and
6265
* the range should be on the bottom
6366
* when the label sits on top.
6467
*/
6568
@include margin(null, 0, $form-control-label-margin, 0);
69+
70+
/**
71+
* Label text should not extend
72+
* beyond the bounds of the range.
73+
*/
74+
max-width: calc(100% / #{$form-control-label-stacked-scale});
6675
}
6776

6877
:host(.in-item.range-label-placement-stacked) .label-text-wrapper {

0 commit comments

Comments
 (0)