You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
155 lines
4.2 KiB
155 lines
4.2 KiB
@charset "UTF-8";
|
|
|
|
@import '../../next-core/lib/next.scss';
|
|
@import './scss/variable.scss';
|
|
|
|
#{$checkbox-prefix} {
|
|
|
|
@include box-sizing;
|
|
|
|
display: inline-block;
|
|
vertical-align: middle;
|
|
position: relative;
|
|
width: $checkbox-size;
|
|
height: $checkbox-size;
|
|
line-height: $checkbox-size - 2;
|
|
|
|
input[type="checkbox"] {
|
|
opacity: 0;
|
|
position: absolute;
|
|
top:0;
|
|
left:0;
|
|
width: $checkbox-size;
|
|
height: $checkbox-size;
|
|
margin: 0;
|
|
}
|
|
|
|
#{$checkbox-prefix}-inner {
|
|
display: inline-block;
|
|
width: 100%;
|
|
height: 100%;
|
|
background: $checkbox-bg-color;
|
|
border-radius: $checkbox-border-radius;
|
|
border: 1px solid $checkbox-border-color;
|
|
transition: ease all 0.3s 0s;
|
|
text-align: left; /* left 才能完全对齐,避免外层继承覆盖*/
|
|
|
|
> .#{$css-prefix}icon {
|
|
opacity: 0;
|
|
transform: scale3d(0, 0, 0);
|
|
line-height: $checkbox-size - 2;
|
|
transition: ease all .3s 0s;
|
|
color: $checkbox-checked-circle-color;
|
|
@if ($checkbox-circle-size == $s-3) {
|
|
margin-top: 1px;
|
|
}
|
|
|
|
@include icon-size($checkbox-circle-size, ($checkbox-size - 2 - $checkbox-circle-size) / 2);
|
|
}
|
|
}
|
|
|
|
&.checked {
|
|
#{$checkbox-prefix}-inner {
|
|
border-color: $checkbox-checked-border-color;
|
|
background-color: $checkbox-checked-bg-color;
|
|
|
|
&:hover {
|
|
border-color: $checkbox-checked-border-color;
|
|
}
|
|
> .#{$css-prefix}icon {
|
|
opacity: 1;
|
|
transform: scale3d(1, 1, 1);
|
|
@include icon-size($checkbox-circle-size, ($checkbox-size - 2 - $checkbox-circle-size) / 2);/*font-size < 12px的时候进行覆盖。*/
|
|
}
|
|
}
|
|
}
|
|
|
|
&.indeterminate {
|
|
#{$checkbox-prefix}-inner {
|
|
border-color: $checkbox-checked-border-color;
|
|
background-color: $checkbox-checked-bg-color;
|
|
|
|
&:hover {
|
|
border-color: $checkbox-checked-border-color;
|
|
}
|
|
> .#{$css-prefix}icon {
|
|
opacity: 1;
|
|
transform: scale3d(1, 1, 1);
|
|
@include icon-size($checkbox-circle-size, ($checkbox-size - 2 - $checkbox-circle-size) / 2);/*font-size < 12px的时候进行覆盖。*/
|
|
}
|
|
}
|
|
}
|
|
|
|
&.disabled {
|
|
input[type="checkbox"] {
|
|
cursor: not-allowed;
|
|
}
|
|
#{$checkbox-prefix}-inner {
|
|
border-color: $checkbox-disabled-border-color;
|
|
background: $checkbox-disabled-bg-color;
|
|
|
|
&:hover {
|
|
border-color: $checkbox-disabled-border-color;
|
|
}
|
|
}
|
|
&.checked,
|
|
&.indeterminate {
|
|
#{$checkbox-prefix}-inner {
|
|
> .#{$css-prefix}icon {
|
|
color: $checkbox-disabled-circle-color;
|
|
opacity: 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
&.hovered,
|
|
&.focused {
|
|
#{$checkbox-prefix}-inner {
|
|
border-color: $checkbox-hovered-border-color;
|
|
background-color: $checkbox-hovered-bg-color;
|
|
}
|
|
}
|
|
|
|
&.indeterminate.hovered,
|
|
&.indeterminate.focused,
|
|
&.checked.hovered,
|
|
&.checked.focused {
|
|
#{$checkbox-prefix}-inner {
|
|
border-color: $checkbox-checked-hovered-border-color;
|
|
background-color: $checkbox-checked-hovered-bg-color;
|
|
|
|
> .#{$css-prefix}icon {
|
|
color: $checkbox-checked-hovered-circle-color;
|
|
opacity: 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
#{$checkbox-prefix}-label {
|
|
@include global-font;
|
|
font-size: $checkbox-font-size;
|
|
vertical-align: middle;
|
|
line-height: 1;
|
|
margin: 0 5px;
|
|
}
|
|
|
|
@-moz-document url-prefix() {
|
|
/* firefox < 57*/
|
|
.#{$css-prefix}checkbox {
|
|
.#{$css-prefix}icon::before{
|
|
margin-top: -1px;
|
|
}
|
|
}
|
|
|
|
@supports (-moz-osx-font-smoothing: auto) and (animation: calc(0s)){
|
|
/* mac firefox 57+*/
|
|
.#{$css-prefix}checkbox {
|
|
.#{$css-prefix}icon::before{
|
|
margin-top: -5px;
|
|
}
|
|
}
|
|
}
|
|
}
|