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.

84 lines
1.3 KiB

@switch-prefix-cls:ant-switch;
10 years ago
@switch-duration:.3s;
10 years ago
.@{switch-prefix-cls} {
10 years ago
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 @ease-in-out-circ;
user-select: none;
10 years ago
&-inner {
color: #fff;
10 years ago
font-size: 12px;
position: absolute;
left: 24px;
10 years ago
}
10 years ago
&:after {
10 years ago
position: absolute;
10 years ago
width: 18px;
height: 18px;
left: 2px;
top: 1px;
border-radius: 100%;
background-color: #fff;
10 years ago
content: " ";
cursor: pointer;
transition: left @switch-duration @ease-in-out-circ;
10 years ago
}
&-small {
height: 14px;
line-height: 12px;
width: 28px;
&:after {
width: 12px;
height: 12px;
top: 0;
left: 0;
}
}
&-small&-checked:after {
left: 14px;
}
&-checked {
border: 1px solid @primary-color;
background-color: @primary-color;
10 years ago
.@{switch-prefix-cls}-inner {
left: 6px;
10 years ago
}
10 years ago
&:after {
10 years ago
left: 22px;
10 years ago
}
}
&-disabled {
cursor: not-allowed;
10 years ago
background: #f4f4f4;
border-color: #f4f4f4;
10 years ago
&:after {
10 years ago
background: #ccc;
cursor: not-allowed;
10 years ago
}
10 years ago
&-inner {
color: #ccc;
10 years ago
}
10 years ago
}
}