mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
75 lines
1.9 KiB
SCSS
75 lines
1.9 KiB
SCSS
|
|
// Material Design Checkbox
|
|
// --------------------------------------------------
|
|
|
|
$checkbox-md-icon-size: 16px !default;
|
|
$checkbox-md-background-color-off: $list-background-color !default;
|
|
$checkbox-md-border-width: 2px !default;
|
|
$checkbox-md-border-radius: 2px !default;
|
|
$checkbox-md-border-color-off: darken($item-md-border-color, 40%) !default;
|
|
$checkbox-md-background-color-on: color(primary) !default;
|
|
$checkbox-md-border-color-on: color(primary) !default;
|
|
$checkbox-md-checkmark-color-on: $background-color !default;
|
|
|
|
|
|
ion-checkbox {
|
|
|
|
&[aria-checked=true] checkbox-icon {
|
|
background-color: $checkbox-md-background-color-on;
|
|
border-color: $checkbox-md-border-color-on;
|
|
}
|
|
|
|
&[aria-checked=true] checkbox-icon:after {
|
|
position: absolute;
|
|
border: 2px solid $checkbox-md-checkmark-color-on;
|
|
top: 0;
|
|
left: 3px;
|
|
width: 4px;
|
|
height: 9px;
|
|
border-left: none;
|
|
border-top: none;
|
|
content: '';
|
|
transform: rotate(45deg);
|
|
}
|
|
|
|
}
|
|
|
|
media-checkbox {
|
|
display: block;
|
|
// TODO convert these to sass variables
|
|
margin: $item-md-padding-media-top 36px $item-md-padding-media-bottom 4px;
|
|
}
|
|
|
|
checkbox-icon {
|
|
position: relative;
|
|
display: block;
|
|
width: $checkbox-md-icon-size;
|
|
height: $checkbox-md-icon-size;
|
|
border-radius: $checkbox-md-border-radius;
|
|
border: $checkbox-md-border-width solid $checkbox-md-border-color-off;
|
|
background-color: $checkbox-md-background-color-off;
|
|
}
|
|
|
|
|
|
// Material Design Checkbox Color Mixin
|
|
// --------------------------------------------------
|
|
|
|
@mixin checkbox-theme-md($color-name, $bg-on) {
|
|
|
|
ion-checkbox[#{$color-name}][aria-checked=true] checkbox-icon {
|
|
background-color: $bg-on;
|
|
border-color: $bg-on;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
// Generate Material Design Checkbox Auxiliary Colors
|
|
// --------------------------------------------------
|
|
|
|
@each $color-name, $color-value in auxiliary-colors() {
|
|
|
|
@include checkbox-theme-md($color-name, $color-value);
|
|
|
|
}
|