fix(range): add slot margins (#16464)

This adds margins between the range slider and its slotted content, such as labels or icons.
This commit is contained in:
Cam Wiegert
2018-11-26 18:54:15 -06:00
committed by GitHub
parent 723d17b868
commit 69f63b3849
3 changed files with 20 additions and 7 deletions

View File

@@ -22,6 +22,14 @@
background: current-color(base);
}
::slotted([slot="start"]) {
@include margin(0, 16px, 0, 0);
}
::slotted([slot="end"]) {
@include margin(0, 0, 0, 16px);
}
:host(.range-has-pin) {
@include padding($range-ios-padding-vertical + $range-ios-pin-font-size, null, null, null);
}

View File

@@ -34,14 +34,13 @@
color: current-color(contrast);
}
// TODO: REVIEW
// .range-md [slot="range-start"] {
// @include margin(0, 12px, 0, 0);
// }
::slotted([slot="start"]) {
@include margin(0, 14px, 0, 0);
}
// .range-md [slot="range-end"] {
// @include margin(0, 0, 0, 12px);
// }
::slotted([slot="end"]) {
@include margin(0, 0, 0, 14px);
}
:host(.range-has-pin) {
@include padding($range-md-padding-vertical + $range-md-pin-font-size + $range-md-pin-padding-vertical, null, null, null);

View File

@@ -43,6 +43,12 @@
<ion-icon name="ios-thermometer" slot="end"></ion-icon>
</ion-range>
</ion-item>
<ion-item>
<ion-range value="40">
<ion-label slot="start">Start</ion-label>
<ion-label slot="end">End</ion-label>
</ion-range>
</ion-item>
</ion-list>
<ion-list>