@import "../../themes/ionic.globals.md"; // Material Design Checkbox // -------------------------------------------------- /// @prop - Border bottom width of the checkbox $checkbox-md-border-bottom-width: 1px !default; /// @prop - Border bottom style of the checkbox $checkbox-md-border-bottom-style: solid !default; /// @prop - Border bottom color of the checkbox $checkbox-md-border-bottom-color: $list-md-border-color !default; /// @prop - Opacity of the disabled checkbox $checkbox-md-disabled-opacity: .3 !default; /// @prop - Background color of the checkbox icon when off $checkbox-md-icon-background-color-off: $list-md-background-color !default; /// @prop - Background color of the checkbox icon when on $checkbox-md-icon-background-color-on: color($colors-md, primary) !default; /// @prop - Size of the checkbox icon $checkbox-md-icon-size: 16px !default; /// @prop - Width of the checkbox icon checkmark $checkbox-md-icon-checkmark-width: 2px !default; /// @prop - Style of the checkbox icon checkmark $checkbox-md-icon-checkmark-style: solid !default; /// @prop - Color of the checkbox icon checkmark $checkbox-md-icon-checkmark-color: color-contrast($colors-md, $checkbox-md-icon-background-color-on) !default; /// @prop - Border width of the checkbox icon $checkbox-md-icon-border-width: 2px !default; /// @prop - Border style of the checkbox icon $checkbox-md-icon-border-style: solid !default; /// @prop - Border radius of the checkbox icon $checkbox-md-icon-border-radius: 2px !default; /// @prop - Border color of the checkbox icon when off $checkbox-md-icon-border-color-off: darken($list-md-border-color, 40%) !default; /// @prop - Border color of the checkbox icon when on $checkbox-md-icon-border-color-on: color($colors-md, primary) !default; /// @prop - Transition duration of the checkbox $checkbox-md-transition-duration: 280ms !default; /// @prop - Transition easing of the checkbox $checkbox-md-transition-easing: cubic-bezier(.4, 0, .2, 1) !default; // deprecated $checkbox-md-item-left-margin: null !default; /// @prop - Margin top of the start checkbox item $checkbox-md-item-start-margin-top: $item-md-padding-media-top !default; /// @prop - Margin end of the start checkbox item $checkbox-md-item-start-margin-end: 36px !default; /// @prop - Margin bottom of the start checkbox item $checkbox-md-item-start-margin-bottom: $item-md-padding-media-bottom !default; /// @prop - Margin start of the start checkbox item $checkbox-md-item-start-margin-start: 4px !default; // deprecated $checkbox-md-item-right-margin: null !default; /// @prop - Margin top of the end checkbox item $checkbox-md-item-end-margin-top: 11px !default; /// @prop - Margin end of the end checkbox item $checkbox-md-item-end-margin-end: 10px !default; /// @prop - Margin bottom of the end checkbox item $checkbox-md-item-end-margin-bottom: 10px !default; /// @prop - Margin start of the end checkbox item $checkbox-md-item-end-margin-start: 0 !default; .checkbox-md { position: relative; display: inline-block; } // Material Design Checkbox Outer Square: Unchecked // ----------------------------------------- .checkbox-md .checkbox-icon { @include border-radius($checkbox-md-icon-border-radius); position: relative; width: $checkbox-md-icon-size; height: $checkbox-md-icon-size; border-width: $checkbox-md-icon-border-width; border-style: $checkbox-md-icon-border-style; border-color: $checkbox-md-icon-border-color-off; background-color: $checkbox-md-icon-background-color-off; transition-duration: $checkbox-md-transition-duration; transition-property: background; transition-timing-function: $checkbox-md-transition-easing; } // Material Design Checkbox Outer Square: Checked // ----------------------------------------- .checkbox-md .checkbox-checked { border-color: $checkbox-md-icon-border-color-on; background-color: $checkbox-md-icon-background-color-on; } // Material Design Checkbox Inner Checkmark: Checked // ----------------------------------------- .checkbox-md .checkbox-checked .checkbox-inner { @include position(0, null, null, 4px); position: absolute; width: 5px; height: 10px; border-width: $checkbox-md-icon-checkmark-width; border-top-width: 0; border-left-width: 0; border-style: $checkbox-md-icon-checkmark-style; border-color: $checkbox-md-icon-checkmark-color; transform: rotate(45deg); } // Material Design Checkbox: Disabled // ----------------------------------------- .checkbox-md.checkbox-disabled, .item-md.item-checkbox-disabled ion-label { opacity: $checkbox-md-disabled-opacity; pointer-events: none; } // Material Design Checkbox Within An Item // ----------------------------------------- .item.item-md .checkbox-md { position: static; display: block; @include deprecated-variable(margin, $checkbox-md-item-left-margin) { @include margin($checkbox-md-item-start-margin-top, $checkbox-md-item-start-margin-end, $checkbox-md-item-start-margin-bottom, $checkbox-md-item-start-margin-start); } } .item.item-md .checkbox-md[item-right], // deprecated .item.item-md .checkbox-md[item-end] { @include deprecated-variable(margin, $checkbox-md-item-right-margin) { @include margin($checkbox-md-item-end-margin-top, $checkbox-md-item-end-margin-end, $checkbox-md-item-end-margin-bottom, $checkbox-md-item-end-margin-start); } } .checkbox-md + .item-inner ion-label { @include margin-horizontal(0, null); } // Material Design Checkbox Color Mixin // -------------------------------------------------- @mixin checkbox-theme-md($color-name, $color-base, $color-contrast) { .checkbox-md-#{$color-name} .checkbox-checked { border-color: $color-base; background-color: $color-base; } .checkbox-md-#{$color-name} .checkbox-checked .checkbox-inner { border-color: $color-contrast; } } // Generate Material Design Checkbox Colors // -------------------------------------------------- @each $color-name, $color-base, $color-contrast in get-colors($colors-md) { @include checkbox-theme-md($color-name, $color-base, $color-contrast); }