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.

102 lines
1.7 KiB

10 years ago
@switchPrefixCls:ant-switch;
@switch-duration:.3s;
10 years ago
10 years ago
.@{switchPrefixCls}{
position: relative;
display: inline-block;
10 years ago
box-sizing: border-box;
width: 44px;
height: 22px;
10 years ago
line-height: 20px;
vertical-align: middle;
border-radius: 20px 20px;
10 years ago
border: 1px solid #ccc;
background-color: #ccc;
10 years ago
cursor: pointer;
transition: all @switch-duration cubic-bezier(0.35, 0, 0.25, 1);
10 years ago
&-inner {
color:#fff;
font-size: 12px;
position: absolute;
left:24px;
}
10 years ago
&:after{
position: absolute;
10 years ago
width: 18px;
height: 18px;
left: 2px;
top:1px;
border-radius: 100%;
10 years ago
background-color: #ffffff;
content: " ";
cursor: pointer;
transform: scale(1);
transition: left @switch-duration cubic-bezier(0.35, 0, 0.25, 1);
10 years ago
animation-timing-function: cubic-bezier(0.35, 0, 0.25, 1);
animation-duration: @switch-duration;
10 years ago
animation-name: rcSwitchOff;
}
&:hover:after{
transform: scale(1.1);
animation-name: rcSwitchOn;
}
&-checked{
border: 1px solid @success-color;
background-color: @success-color;
10 years ago
.@{switchPrefixCls}-inner {
left:6px;
}
10 years ago
&:after{
10 years ago
left: 22px;
10 years ago
}
}
&-disabled{
cursor: no-drop;
9 years ago
background: #f4f4f4;
border-color:#f4f4f4;
10 years ago
&:after{
9 years ago
background: #ccc;
10 years ago
animation-name: none;
cursor: no-drop;
}
&:hover:after{
transform: scale(1);
animation-name: none;
}
9 years ago
&-inner {
color:#ccc;
}
10 years ago
}
}
@keyframes rcSwitchOn {
0% {
transform: scale(1);
}
50% {
transform: scale(1.25);
}
100% {
transform: scale(1.1);
}
}
@keyframes rcSwitchOff {
0% {
transform: scale(1.1);
}
100% {
transform: scale(1);
}
}