mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-27 05:00:48 +08:00
83 lines
2.1 KiB
SCSS
83 lines
2.1 KiB
SCSS
@import './mixins/mixins.scss';
|
|
@import './themes/vars.scss';
|
|
|
|
@include themes-mixin{
|
|
@include b(switch) {
|
|
@include once {
|
|
user-select: none;
|
|
display: inline-block;
|
|
}
|
|
@include e(rail) {
|
|
@include once {
|
|
cursor: pointer;
|
|
position: relative;
|
|
height: 14px;
|
|
width: 30px;
|
|
border-radius: 7px;
|
|
margin: 3px;
|
|
transition: background-color .2s $default-cubic-bezier;
|
|
&::before, &::after {
|
|
box-sizing: border-box;
|
|
cursor: inherit;
|
|
content: "";
|
|
position: absolute;
|
|
height: 20px;
|
|
width: 24px;
|
|
max-width: 20px;
|
|
border-radius: 10px;
|
|
top: -3px;
|
|
left: -3px;
|
|
// transition: left .2s $default-cubic-bezier, opacity .2s $default-cubic-bezier, max-width .2s $default-cubic-bezier;
|
|
}
|
|
&::before {
|
|
opacity: 1;
|
|
}
|
|
&::after {
|
|
opacity: 0;
|
|
}
|
|
@include not-m(disabled) {
|
|
&:active::before, &:active::after {
|
|
max-width: 24px;
|
|
}
|
|
@include m(active) {
|
|
&:active::before, &:active::after {
|
|
left: 9px;
|
|
}
|
|
}
|
|
}
|
|
@include m(active) {
|
|
&::before {
|
|
left: 13px;
|
|
opacity: 1;
|
|
}
|
|
&::after {
|
|
left: 13px;
|
|
opacity: 1;
|
|
}
|
|
}
|
|
}
|
|
&::before {
|
|
box-shadow: $--switch-switcher-box-shadow;
|
|
transition: $--switch-switcher-transition;
|
|
}
|
|
&::after {
|
|
transition: $--switch-switcher-transition;
|
|
}
|
|
background-color: map-get($map: $--switch-rail-background-color, $key: 'inactive');
|
|
&::before {
|
|
background-image: map-get($map: $--switch-switcher-color, $key: 'inactive');
|
|
}
|
|
&::after {
|
|
background-image: map-get($map: $--switch-switcher-color, $key: 'active');
|
|
}
|
|
@include m(active) {
|
|
background-color: map-get($map: $--switch-rail-background-color, $key: 'active');
|
|
}
|
|
@include m(disabled) {
|
|
cursor: not-allowed;
|
|
opacity: .5;
|
|
}
|
|
}
|
|
}
|
|
}
|