mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
113 lines
2.9 KiB
SCSS
113 lines
2.9 KiB
SCSS
@import "../../themes/native/native.globals";
|
|
@import "toggle.common";
|
|
|
|
:host {
|
|
z-index: $z-index-item-input;
|
|
}
|
|
|
|
:host(.in-item) .label-text-wrapper {
|
|
@include margin($toggle-item-label-margin-top, null, $toggle-item-label-margin-bottom, null);
|
|
}
|
|
|
|
:host(.in-item.toggle-label-placement-stacked) .label-text-wrapper {
|
|
@include margin($toggle-item-label-margin-top, null, $form-control-label-margin, null);
|
|
}
|
|
|
|
:host(.in-item.toggle-label-placement-stacked) .native-wrapper {
|
|
@include margin(null, null, $toggle-item-label-margin-bottom, null);
|
|
}
|
|
|
|
// Input Label
|
|
// ----------------------------------------------------------------
|
|
|
|
.label-text-wrapper {
|
|
text-overflow: ellipsis;
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
}
|
|
|
|
// Input Label Placement - Fixed
|
|
// ----------------------------------------------------------------
|
|
|
|
:host(.toggle-label-placement-fixed) .label-text-wrapper {
|
|
/**
|
|
* The margin between the label and
|
|
* the input should be on the end
|
|
* when the label sits at the start.
|
|
*/
|
|
@include margin(null, $form-control-label-margin, null, 0);
|
|
}
|
|
|
|
/**
|
|
* Label is on the left of the input in LTR and
|
|
* on the right in RTL. Label also has a fixed width.
|
|
*/
|
|
:host(.toggle-label-placement-fixed) .label-text-wrapper {
|
|
flex: 0 0 100px;
|
|
|
|
width: 100px;
|
|
min-width: 100px;
|
|
max-width: 200px;
|
|
}
|
|
|
|
// Toggle Label Placement - Stacked
|
|
// ----------------------------------------------------------------
|
|
|
|
/**
|
|
* Label is on top of the toggle.
|
|
*/
|
|
:host(.toggle-label-placement-stacked) .toggle-wrapper {
|
|
flex-direction: column;
|
|
}
|
|
|
|
:host(.toggle-label-placement-stacked) .label-text-wrapper {
|
|
@include transform(scale(#{$form-control-label-stacked-scale}));
|
|
|
|
/**
|
|
* The margin between the label and
|
|
* the toggle 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 toggle.
|
|
*/
|
|
max-width: calc(100% / #{$form-control-label-stacked-scale});
|
|
}
|
|
|
|
:host(.toggle-label-placement-stacked.toggle-alignment-start) .label-text-wrapper {
|
|
@include transform-origin(start, top);
|
|
}
|
|
|
|
:host(.toggle-label-placement-stacked.toggle-alignment-center) .label-text-wrapper {
|
|
@include transform-origin(center, top);
|
|
}
|
|
|
|
// Toggle Label Placement - Start
|
|
// ----------------------------------------------------------------
|
|
|
|
:host(.toggle-label-placement-start) .label-text-wrapper {
|
|
/**
|
|
* The margin between the label and
|
|
* the input should be on the end
|
|
* when the label sits at the start.
|
|
*/
|
|
@include margin(null, $form-control-label-margin, null, 0);
|
|
}
|
|
|
|
// Toggle Label Placement - End
|
|
// ----------------------------------------------------------------
|
|
|
|
/**
|
|
* The margin between the label and
|
|
* the input should be on the start
|
|
* when the label sits at the end.
|
|
*/
|
|
:host(.toggle-label-placement-end) .label-text-wrapper {
|
|
@include margin(null, 0, null, $form-control-label-margin);
|
|
}
|