Skip to content

Commit 69f63b3

Browse files
authored
fix(range): add slot margins (#16464)
This adds margins between the range slider and its slotted content, such as labels or icons.
1 parent 723d17b commit 69f63b3

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

core/src/components/range/range.ios.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@
2222
background: current-color(base);
2323
}
2424

25+
::slotted([slot="start"]) {
26+
@include margin(0, 16px, 0, 0);
27+
}
28+
29+
::slotted([slot="end"]) {
30+
@include margin(0, 0, 0, 16px);
31+
}
32+
2533
:host(.range-has-pin) {
2634
@include padding($range-ios-padding-vertical + $range-ios-pin-font-size, null, null, null);
2735
}

core/src/components/range/range.md.scss

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,13 @@
3434
color: current-color(contrast);
3535
}
3636

37-
// TODO: REVIEW
38-
// .range-md [slot="range-start"] {
39-
// @include margin(0, 12px, 0, 0);
40-
// }
41-
42-
// .range-md [slot="range-end"] {
43-
// @include margin(0, 0, 0, 12px);
44-
// }
37+
::slotted([slot="start"]) {
38+
@include margin(0, 14px, 0, 0);
39+
}
40+
41+
::slotted([slot="end"]) {
42+
@include margin(0, 0, 0, 14px);
43+
}
4544

4645
:host(.range-has-pin) {
4746
@include padding($range-md-padding-vertical + $range-md-pin-font-size + $range-md-pin-padding-vertical, null, null, null);

core/src/components/range/test/basic/index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@
4343
<ion-icon name="ios-thermometer" slot="end"></ion-icon>
4444
</ion-range>
4545
</ion-item>
46+
<ion-item>
47+
<ion-range value="40">
48+
<ion-label slot="start">Start</ion-label>
49+
<ion-label slot="end">End</ion-label>
50+
</ion-range>
51+
</ion-item>
4652
</ion-list>
4753

4854
<ion-list>

0 commit comments

Comments
 (0)