104 lines
1.9 KiB
Text
104 lines
1.9 KiB
Text
![]() |
@switch-prefix-cls: ~"@{css-prefix}switch";
|
||
|
|
||
|
.@{switch-prefix-cls} {
|
||
|
display: inline-block;
|
||
|
width: 44px;
|
||
|
height: 24px;
|
||
|
line-height: 22px;
|
||
|
border-radius: 22px;
|
||
|
vertical-align: middle;
|
||
|
border: 1px solid #ccc;
|
||
|
background-color: #ccc;
|
||
|
position: relative;
|
||
|
cursor: pointer;
|
||
|
user-select: none;
|
||
|
.transition(all @transition-time @ease-in-out);
|
||
|
|
||
|
&-inner {
|
||
|
color: #fff;
|
||
|
font-size: 12px;
|
||
|
position: absolute;
|
||
|
left: 24px;
|
||
|
}
|
||
|
|
||
|
&:after {
|
||
|
content: '';
|
||
|
width: 22px;
|
||
|
height: 22px;
|
||
|
border-radius: 50%;
|
||
|
background-color: #fff;
|
||
|
position: absolute;
|
||
|
left: 0;
|
||
|
top: 0;
|
||
|
cursor: pointer;
|
||
|
.transition2(left @transition-time @ease-in-out, width @transition-time @ease-in-out);
|
||
|
}
|
||
|
|
||
|
&:active:after {
|
||
|
width: 26px;
|
||
|
}
|
||
|
|
||
|
&:focus {
|
||
|
box-shadow: 0 0 0 2px fade(@primary-color, 20%);
|
||
|
outline: 0;
|
||
|
}
|
||
|
|
||
|
&:focus:hover {
|
||
|
box-shadow: none;
|
||
|
}
|
||
|
|
||
|
&-small {
|
||
|
height: 14px;
|
||
|
line-height: 12px;
|
||
|
width: 28px;
|
||
|
&:after {
|
||
|
width: 12px;
|
||
|
height: 12px;
|
||
|
top: 0;
|
||
|
left: 0;
|
||
|
}
|
||
|
&:active:after {
|
||
|
width: 16px;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
&-small&-checked:after {
|
||
|
left: 14px;
|
||
|
}
|
||
|
|
||
|
&-small:active&-checked:after {
|
||
|
left: 10px;
|
||
|
}
|
||
|
|
||
|
&-checked {
|
||
|
border-color: @primary-color;
|
||
|
background-color: @primary-color;
|
||
|
|
||
|
.@{switch-prefix-cls}-inner {
|
||
|
left: 6px;
|
||
|
}
|
||
|
|
||
|
&:after {
|
||
|
left: 20px;
|
||
|
}
|
||
|
|
||
|
&:active:after {
|
||
|
left: 16px;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
&-disabled {
|
||
|
cursor: @cursor-disabled;
|
||
|
background: #f3f3f3;
|
||
|
border-color: #f3f3f3;
|
||
|
|
||
|
&:after {
|
||
|
background: #ccc;
|
||
|
cursor: not-allowed;
|
||
|
}
|
||
|
|
||
|
.@{switch-prefix-cls}-inner {
|
||
|
color: #ccc;
|
||
|
}
|
||
|
}
|
||
|
}
|