mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-16 18:17:31 +08:00
84 lines
2.0 KiB
SCSS
84 lines
2.0 KiB
SCSS
@import "./checkbox";
|
|
@import "./checkbox.ios.vars";
|
|
|
|
// iOS Checkbox
|
|
// --------------------------------------------------
|
|
|
|
:host {
|
|
--size: #{$checkbox-ios-icon-size};
|
|
|
|
// Border
|
|
--border-radius: #{$checkbox-ios-icon-border-radius};
|
|
--border-width: #{$checkbox-ios-icon-border-width};
|
|
--border-style: #{$checkbox-ios-icon-border-style};
|
|
--border-color: #{$checkbox-ios-icon-border-color-off};
|
|
|
|
// Background
|
|
--background: #{$checkbox-ios-background-color-off};
|
|
}
|
|
|
|
// iOS Checkbox Inner Checkmark: Checked
|
|
// -----------------------------------------
|
|
|
|
.checkbox-inner {
|
|
@include position(calc(var(--size) / 6), null, null, calc(var(--size) / 2.5 - 1px));
|
|
|
|
position: absolute;
|
|
|
|
width: calc(var(--size) / 6 + 1px);
|
|
height: calc(var(--size) / 2);
|
|
|
|
transform: rotate(45deg);
|
|
|
|
border-width: $checkbox-ios-checkmark-border-width;
|
|
border-top-width: 0;
|
|
border-left-width: 0;
|
|
border-style: $checkbox-ios-checkmark-border-style;
|
|
}
|
|
|
|
|
|
// iOS Checkbox: Disabled
|
|
// -----------------------------------------
|
|
|
|
// TODO: .item-ios.item-checkbox-disabled ion-labe
|
|
:host(.checkbox-disabled) {
|
|
opacity: $checkbox-ios-disabled-opacity;
|
|
pointer-events: none;
|
|
}
|
|
|
|
|
|
// iOS Checkbox Keyboard Focus
|
|
// -----------------------------------------
|
|
|
|
:host(.checkbox-key) .checkbox-icon::after {
|
|
@include border-radius(50%);
|
|
@include position(-9px, null, null, -9px);
|
|
|
|
display: block;
|
|
position: absolute;
|
|
|
|
width: 36px;
|
|
height: 36px;
|
|
|
|
background: $checkbox-ios-background-color-focused;
|
|
|
|
content: "";
|
|
opacity: .2;
|
|
}
|
|
|
|
|
|
// iOS Checkbox Within An Item
|
|
// -----------------------------------------
|
|
|
|
// :host-context(.item)
|
|
:host(.in-item) {
|
|
@include margin($checkbox-ios-item-start-margin-top, $checkbox-ios-item-start-margin-end, $checkbox-ios-item-start-margin-bottom, $checkbox-ios-item-start-margin-start);
|
|
|
|
display: block;
|
|
position: static;
|
|
}
|
|
|
|
:host(.in-item[slot="end"]) {
|
|
@include margin($checkbox-ios-item-end-margin-top, $checkbox-ios-item-end-margin-end, $checkbox-ios-item-end-margin-bottom, $checkbox-ios-item-end-margin-start);
|
|
}
|