mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 06:57:02 +08:00
49 lines
1.1 KiB
SCSS
49 lines
1.1 KiB
SCSS
|
|
.checkbox {
|
|
position: relative;
|
|
display: inline-block;
|
|
padding: ($checkbox-height / 4) ($checkbox-width / 4);
|
|
cursor: pointer;
|
|
|
|
input {
|
|
display: none;
|
|
}
|
|
|
|
/* what the checkbox looks like when its not checked */
|
|
.handle {
|
|
width: $checkbox-width;
|
|
height: $checkbox-height;
|
|
border: $checkbox-border-width solid $checkbox-off-border-color;
|
|
border-radius: $checkbox-border-radius;
|
|
background: $checkbox-off-bg-color;
|
|
transition: background-color .1s ease-in-out;
|
|
}
|
|
|
|
/* the checkmark within the box */
|
|
.handle:after {
|
|
position: absolute;
|
|
top: 37%;
|
|
left: $checkbox-width / 2;
|
|
width: $checkbox-width / 2;
|
|
height: $checkbox-width / 4;
|
|
border: $checkbox-check-width solid $checkbox-check-color;
|
|
border-top: none;
|
|
border-right: none;
|
|
content: '';
|
|
opacity: 0;
|
|
transition: opacity .1s ease-in-out;
|
|
|
|
-webkit-transform: rotate(-45deg);
|
|
transform: rotate(-45deg);
|
|
}
|
|
|
|
/* what it looks like when it is checked */
|
|
input:checked + .handle {
|
|
background: $checkbox-on-bg-color;
|
|
|
|
&:after {
|
|
opacity: 1;
|
|
}
|
|
}
|
|
|
|
} |