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.

118 lines
2.1 KiB

@import "../../style/themes/default";
@import "../../style/mixins/index";
10 years ago
@switch-prefix-cls: ~"@{ant-prefix}-switch";
@switch-duration: .36s;
10 years ago
.@{switch-prefix-cls} {
.reset-component;
10 years ago
position: relative;
display: inline-block;
10 years ago
box-sizing: border-box;
height: @switch-height;
min-width: 44px;
line-height: @switch-height - 2px;
10 years ago
vertical-align: middle;
border-radius: 100px;
border: 1px solid transparent;
background-color: @disabled-color;
10 years ago
cursor: pointer;
transition: all @switch-duration;
user-select: none;
10 years ago
&-inner {
color: #fff;
font-size: @font-size-sm;
margin-left: 24px;
margin-right: 6px;
display: block;
10 years ago
}
10 years ago
&:after {
10 years ago
position: absolute;
width: @switch-height - 4px;
height: @switch-height - 4px;
left: 1px;
top: 1px;
border-radius: 18px;
background-color: @component-background;
10 years ago
content: " ";
cursor: pointer;
transition: all @switch-duration @ease-in-out-circ;
}
&:active:after {
width: 24px;
10 years ago
}
&:focus {
box-shadow: 0 0 0 2px fade(@primary-color, 20%);
outline: 0;
}
&:focus:hover {
box-shadow: none;
}
&-small {
height: @switch-sm-height;
min-width: 28px;
line-height: @switch-sm-height - 2px;
.@{switch-prefix-cls}-inner {
margin-left: 18px;
margin-right: 3px;
font-size: @font-size-sm;
}
&:after {
width: @switch-sm-height - 4px;
height: @switch-sm-height - 4px;
}
&:active:after {
width: 16px;
}
}
&-small&-checked {
&:after {
left: 100%;
margin-left: -12.5px;
}
.@{switch-prefix-cls}-inner {
margin-left: 3px;
margin-right: 18px;
}
}
&-small:active&-checked:after {
margin-left: -16.5px;
}
&-checked {
background-color: @primary-color;
10 years ago
.@{switch-prefix-cls}-inner {
margin-left: 6px;
margin-right: 24px;
10 years ago
}
10 years ago
&:after {
left: 100%;
margin-left: -19px;
10 years ago
}
&:active:after {
margin-left: -25px;
}
10 years ago
}
&-disabled {
cursor: not-allowed;
opacity: 0.35;
10 years ago
}
}