优化 checks 样式

This commit is contained in:
liaoxuezhi 2019-06-20 18:10:40 +08:00
parent 8ae34532e9
commit cb8dca1b2f
1 changed files with 17 additions and 1 deletions

View File

@ -1,6 +1,5 @@
.#{$ns}Checkbox { .#{$ns}Checkbox {
margin: 0 $gap-sm 0 0; margin: 0 $gap-sm 0 0;
cursor: pointer;
font-weight: $fontWeightNormal; font-weight: $fontWeightNormal;
user-select: none; user-select: none;
@ -15,6 +14,7 @@
} }
> i { > i {
cursor: pointer;
line-height: 1; line-height: 1;
background-color: #fff; background-color: #fff;
display: inline-block; display: inline-block;
@ -23,6 +23,7 @@
+ span { + span {
margin-left: $Checkbox-gap; margin-left: $Checkbox-gap;
cursor: pointer;
&:empty { &:empty {
display: none; display: none;
@ -63,11 +64,18 @@
&[disabled] + i { &[disabled] + i {
border-color: lighten($Checkbox-color, 5%); border-color: lighten($Checkbox-color, 5%);
cursor: default;
&:before { &:before {
background-color: lighten($Checkbox-color, 5%); background-color: lighten($Checkbox-color, 5%);
border-color: $white;
} }
} }
&[disabled] + i + span {
cursor: default;
color: $text--muted-color;
}
} }
> i { > i {
@ -121,6 +129,7 @@
> i { > i {
position: relative; position: relative;
cursor: pointer;
&:before { &:before {
content: ""; content: "";
@ -159,14 +168,21 @@
&[disabled] + i { &[disabled] + i {
border-color: lighten($Radio-color, 5%); border-color: lighten($Radio-color, 5%);
cursor: default;
&:before { &:before {
background-color: lighten($Radio-color, 5%); background-color: lighten($Radio-color, 5%);
} }
} }
&[disabled] + i + span {
cursor: default;
color: $text--muted-color;
}
} }
> i { > i {
cursor: pointer;
width: $Radio-size; width: $Radio-size;
height: $Radio-size; height: $Radio-size;
border: px2rem(1px) solid $Radio-color; border: px2rem(1px) solid $Radio-color;