2015-07-08 19:47:45 +08:00
|
|
|
@switchPrefixCls:ant-switch;
|
|
|
|
|
2015-07-13 16:51:56 +08:00
|
|
|
@switch-duration:.3s;
|
2015-07-09 21:05:33 +08:00
|
|
|
|
2015-07-08 19:47:45 +08:00
|
|
|
.@{switchPrefixCls}{
|
|
|
|
position: relative;
|
|
|
|
display: inline-block;
|
2015-07-09 21:05:33 +08:00
|
|
|
box-sizing: border-box;
|
|
|
|
width: 44px;
|
|
|
|
height: 22px;
|
2015-07-08 19:47:45 +08:00
|
|
|
line-height: 20px;
|
|
|
|
vertical-align: middle;
|
|
|
|
border-radius: 20px 20px;
|
2015-07-09 21:05:33 +08:00
|
|
|
border: 1px solid #ccc;
|
|
|
|
background-color: #ccc;
|
2015-07-08 19:47:45 +08:00
|
|
|
cursor: pointer;
|
2015-07-13 16:51:56 +08:00
|
|
|
transition: all @switch-duration cubic-bezier(0.35, 0, 0.25, 1);
|
2015-07-09 21:05:33 +08:00
|
|
|
|
|
|
|
&-inner {
|
|
|
|
color:#fff;
|
|
|
|
font-size: 12px;
|
|
|
|
position: absolute;
|
|
|
|
left:24px;
|
|
|
|
}
|
2015-07-08 19:47:45 +08:00
|
|
|
|
|
|
|
&:after{
|
|
|
|
position: absolute;
|
2015-07-09 21:05:33 +08:00
|
|
|
width: 18px;
|
|
|
|
height: 18px;
|
|
|
|
left: 2px;
|
|
|
|
top:1px;
|
2015-07-13 16:51:56 +08:00
|
|
|
border-radius: 100%;
|
2015-07-08 19:47:45 +08:00
|
|
|
background-color: #ffffff;
|
|
|
|
content: " ";
|
|
|
|
cursor: pointer;
|
|
|
|
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26);
|
|
|
|
transform: scale(1);
|
2015-07-13 16:51:56 +08:00
|
|
|
transition: left @switch-duration cubic-bezier(0.35, 0, 0.25, 1);
|
2015-07-08 19:47:45 +08:00
|
|
|
animation-timing-function: cubic-bezier(0.35, 0, 0.25, 1);
|
2015-07-13 16:51:56 +08:00
|
|
|
animation-duration: @switch-duration;
|
2015-07-08 19:47:45 +08:00
|
|
|
animation-name: rcSwitchOff;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover:after{
|
|
|
|
transform: scale(1.1);
|
|
|
|
animation-name: rcSwitchOn;
|
|
|
|
}
|
|
|
|
|
|
|
|
&-checked{
|
2015-07-09 21:05:33 +08:00
|
|
|
border: 1px solid #87d068;
|
|
|
|
background-color: #87d068;
|
|
|
|
|
|
|
|
.@{switchPrefixCls}-inner {
|
|
|
|
left:6px;
|
|
|
|
}
|
2015-07-08 19:47:45 +08:00
|
|
|
|
|
|
|
&:after{
|
2015-07-09 21:05:33 +08:00
|
|
|
left: 22px;
|
2015-07-08 19:47:45 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&-disabled{
|
|
|
|
cursor: no-drop;
|
2015-07-09 21:05:33 +08:00
|
|
|
background: #ccc;
|
|
|
|
border-color:#ccc;
|
2015-07-08 19:47:45 +08:00
|
|
|
|
|
|
|
&:after{
|
|
|
|
background: #9e9e9e;
|
|
|
|
animation-name: none;
|
|
|
|
cursor: no-drop;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover:after{
|
|
|
|
transform: scale(1);
|
|
|
|
animation-name: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&-label {
|
|
|
|
display: inline-block;
|
|
|
|
line-height: 20px;
|
|
|
|
font-size: 14px;
|
|
|
|
padding-left: 10px;
|
|
|
|
vertical-align: middle;
|
|
|
|
white-space: normal;
|
|
|
|
pointer-events: none;
|
|
|
|
user-select: text;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@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);
|
|
|
|
}
|
|
|
|
}
|