mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-27 05:00:48 +08:00
156 lines
4.3 KiB
SCSS
156 lines
4.3 KiB
SCSS
@import "./mixins/mixins.scss";
|
|
|
|
@include themes-mixin {
|
|
@include once {
|
|
@include b(checkbox-group) {
|
|
font-size: 14px;
|
|
line-height: 14px;
|
|
@include b(checkbox) {
|
|
margin-right: 18px;
|
|
}
|
|
}
|
|
@include b(checkbox) {
|
|
line-height: 14px;
|
|
outline: none;
|
|
font-size: 14px;
|
|
cursor: pointer;
|
|
display: inline-block;
|
|
white-space: nowrap;
|
|
@include b(checkbox-box) {
|
|
display: inline-block;
|
|
height: 14px;
|
|
width: 14px;
|
|
vertical-align: middle;
|
|
box-sizing: border-box;
|
|
border-radius: 4px;
|
|
position: relative;
|
|
transition: box-shadow 0.3s $--n-ease-in-out-cubic-bezier,
|
|
background-color 0.3s $--n-ease-in-out-cubic-bezier;
|
|
@include e(line-mark, check-mark) {
|
|
path {
|
|
transition: fill .3s $--n-ease-in-out-cubic-bezier;
|
|
fill: $--checkbox-icon-fill;
|
|
}
|
|
}
|
|
@include e(line-mark) {
|
|
position: absolute;
|
|
top: 1px;
|
|
left: 1px;
|
|
right: 1px;
|
|
bottom: 1px;
|
|
width: calc(100% - 2px);
|
|
opacity: 0;
|
|
transform: scale(0.5);
|
|
transform-origin: center;
|
|
transition: transform 0.3s $--n-ease-in-out-cubic-bezier,
|
|
opacity 0.3s $--n-ease-in-out-cubic-bezier,
|
|
border-color 0.3s $--n-ease-in-out-cubic-bezier;
|
|
}
|
|
@include e(check-mark) {
|
|
content: "";
|
|
position: absolute;
|
|
top: 1px;
|
|
left: 1px;
|
|
right: 1px;
|
|
bottom: 1px;
|
|
width: calc(100% - 2px);
|
|
opacity: 0;
|
|
transform: scale(0.5);
|
|
transform-origin: center;
|
|
transition: transform 0.3s $--n-ease-in-out-cubic-bezier,
|
|
opacity 0.3s $--n-ease-in-out-cubic-bezier,
|
|
border-color 0.3s $--n-ease-in-out-cubic-bezier;
|
|
}
|
|
}
|
|
@include e(label) {
|
|
transition: color .3s $--n-ease-in-out-cubic-bezier;
|
|
user-select: none;
|
|
padding-left: 8px;
|
|
}
|
|
@include m(checked) {
|
|
@include b(checkbox-box) {
|
|
@include e(check-mark) {
|
|
opacity: 1;
|
|
transform: scale(1);
|
|
}
|
|
}
|
|
}
|
|
@include m(indeterminate) {
|
|
@include b(checkbox-box) {
|
|
@include e(check-mark) {
|
|
opacity: 0;
|
|
transform: scale(.5);
|
|
}
|
|
@include e(line-mark) {
|
|
opacity: 1;
|
|
transform: scale(1);
|
|
}
|
|
}
|
|
}
|
|
@include m(disabled) {
|
|
cursor: not-allowed;
|
|
}
|
|
}
|
|
}
|
|
@include b(checkbox) {
|
|
&:hover {
|
|
@include b(checkbox-box) {
|
|
box-shadow: inset 0 0 0 1px $--checkbox-border-color--active;
|
|
}
|
|
}
|
|
&:focus {
|
|
@include b(checkbox-box) {
|
|
box-shadow: inset 0 0 0 1px $--checkbox-border-color--active;
|
|
}
|
|
}
|
|
@include b(checkbox-box) {
|
|
background-color: map-get($--checkbox-background-color, 'default');
|
|
box-shadow: inset 0 0 0 1px $--checkbox-border-color;
|
|
@include e(line-mark) {
|
|
path {
|
|
fill: $--checkbox-indeterminate-color;
|
|
}
|
|
}
|
|
@include e(check-mark) {
|
|
path {
|
|
fill: $--checkbox-indeterminate-color;
|
|
}
|
|
}
|
|
}
|
|
@include e(label) {
|
|
color: map-get($--checkbox-label-text-color, 'default');
|
|
}
|
|
@include m(checked, indeterminate) {
|
|
&:focus {
|
|
@include b(checkbox-box) {
|
|
box-shadow: inset 0 0 0 1px $--checkbox-border-color--active, 0 0 0 2px change-color($--checkbox-border-color--active, $alpha: .3);
|
|
}
|
|
}
|
|
@include b(checkbox-box) {
|
|
background-color: $--checkbox-border-color--active;
|
|
box-shadow: inset 0 0 0 1px $--checkbox-border-color--active;
|
|
border-left: 0;
|
|
border-top: 0;
|
|
}
|
|
}
|
|
@include m(disabled) {
|
|
@include b(checkbox-box) {
|
|
background-color: map-get($--checkbox-background-color, 'disabled');
|
|
box-shadow: inset 0 0 0 1px $--checkbox-disabled;
|
|
@include e(check-mark) {
|
|
path {
|
|
fill: $--checkbox-disabled;
|
|
}
|
|
}
|
|
@include e(line-mark) {
|
|
path {
|
|
fill: $--checkbox-disabled;
|
|
}
|
|
}
|
|
}
|
|
@include e(label) {
|
|
color: map-get($--checkbox-label-text-color, 'disabled');
|
|
}
|
|
}
|
|
}
|
|
} |