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.

129 lines
2.1 KiB

@import "../../style/themes/default";
@import "../../style/mixins/index";
10 years ago
@switch-prefix-cls: ~"@{ant-prefix}-switch";
@switch-duration: .3s;
10 years ago
.@{switch-prefix-cls} {
10 years ago
position: relative;
display: inline-block;
10 years ago
box-sizing: border-box;
height: 22px;
min-width: 44px;
10 years ago
line-height: 20px;
vertical-align: middle;
9 years ago
border-radius: 20px;
10 years ago
border: 1px solid #ccc;
background-color: #ccc;
10 years ago
cursor: pointer;
transition: all @switch-duration;
user-select: none;
10 years ago
&-inner {
color: #fff;
font-size: @font-size-base;
margin-left: 24px;
margin-right: 6px;
display: block;
10 years ago
}
10 years ago
&:after {
10 years ago
position: absolute;
10 years ago
width: 18px;
height: 18px;
left: 1px;
top: 1px;
border-radius: 18px;
background-color: @body-background;
10 years ago
content: " ";
cursor: pointer;
transition: all @switch-duration, width @switch-duration;
}
&: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: 14px;
min-width: 28px;
line-height: 12px;
.@{switch-prefix-cls}-inner {
margin-left: 18px;
margin-right: 3px;
}
&:after {
width: 12px;
height: 12px;
top: 0;
left: 0.5px;
}
&: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 {
border-color: @primary-color;
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;
background: #f4f4f4;
border-color: #f4f4f4;
10 years ago
&:after {
10 years ago
background: #ccc;
cursor: not-allowed;
10 years ago
}
9 years ago
.@{switch-prefix-cls}-inner {
color: #ccc;
10 years ago
}
10 years ago
}
}