mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Issue number: internal --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? No ionic theme custom implementation existed for the ion-range component. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Added ionic theme specific styling (based on the ios styling) for the range according to UX requirements. ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer for more information. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> 
84 lines
2.2 KiB
SCSS
84 lines
2.2 KiB
SCSS
@import "range.common";
|
|
@import "../../themes/native/native.globals";
|
|
@import "./range.vars.scss";
|
|
|
|
:host {
|
|
--knob-handle-size: calc(var(--knob-size) * 2);
|
|
|
|
font-family: $font-family-base;
|
|
|
|
z-index: $z-index-item-input;
|
|
}
|
|
|
|
::slotted(ion-icon[slot]) {
|
|
font-size: 24px;
|
|
}
|
|
|
|
::slotted([slot="label"]) {
|
|
max-width: 200px;
|
|
}
|
|
|
|
// Range Label Placement - Start
|
|
// ----------------------------------------------------------------
|
|
|
|
:host(.range-label-placement-start) .label-text-wrapper {
|
|
/**
|
|
* The margin between the label and
|
|
* the range should be on the end
|
|
* when the label sits at the start.
|
|
*/
|
|
@include margin(0, $form-control-label-margin, 0, 0);
|
|
}
|
|
|
|
// Range Label Placement - End
|
|
// ----------------------------------------------------------------
|
|
|
|
:host(.range-label-placement-end) .label-text-wrapper {
|
|
/**
|
|
* The margin between the label and
|
|
* the range should be on the start
|
|
* when the label sits at the end.
|
|
*/
|
|
@include margin(0, 0, 0, $form-control-label-margin);
|
|
}
|
|
|
|
// Range Label Placement - Fixed
|
|
// ----------------------------------------------------------------
|
|
|
|
:host(.range-label-placement-fixed) .label-text-wrapper {
|
|
/**
|
|
* The margin between the label and
|
|
* the range should be on the end
|
|
* when the label sits at the start.
|
|
*/
|
|
@include margin(0, $form-control-label-margin, 0, 0);
|
|
}
|
|
|
|
// Range Label Placement - Stacked
|
|
// ----------------------------------------------------------------
|
|
|
|
:host(.range-label-placement-stacked) .label-text-wrapper {
|
|
@include transform(scale(#{$form-control-label-stacked-scale}));
|
|
|
|
/**
|
|
* The margin between the label and
|
|
* the range should be on the bottom
|
|
* when the label sits on top.
|
|
*/
|
|
@include margin(null, 0, $form-control-label-margin, 0);
|
|
|
|
/**
|
|
* Label text should not extend
|
|
* beyond the bounds of the range.
|
|
*/
|
|
max-width: calc(100% / #{$form-control-label-stacked-scale});
|
|
}
|
|
|
|
:host(.in-item.range-label-placement-stacked) .label-text-wrapper {
|
|
@include margin($range-item-label-margin-top, null, $form-control-label-margin, null);
|
|
}
|
|
|
|
:host(.in-item.range-label-placement-stacked) .native-wrapper {
|
|
@include margin(null, null, $range-item-label-margin-bottom, null);
|
|
}
|