ant-design/style/components/switch.less

84 lines
1.3 KiB
Plaintext
Raw Normal View History

2015-08-20 16:55:42 +08:00
@switch-prefix-cls:ant-switch;
2015-07-08 19:47:45 +08:00
2015-07-13 16:51:56 +08:00
@switch-duration:.3s;
2015-07-09 21:05:33 +08:00
2015-11-26 19:32:55 +08:00
.@{switch-prefix-cls} {
2015-07-08 19:47:45 +08:00
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;
2016-02-03 17:45:42 +08:00
border-radius: 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-17 17:21:04 +08:00
transition: all @switch-duration @ease-in-out-circ;
2015-09-23 11:44:39 +08:00
user-select: none;
2015-07-09 21:05:33 +08:00
&-inner {
2015-11-26 19:32:55 +08:00
color: #fff;
2015-07-09 21:05:33 +08:00
font-size: 12px;
position: absolute;
left: 24px;
2015-07-09 21:05:33 +08:00
}
2015-07-08 19:47:45 +08:00
2015-11-26 19:32:55 +08:00
&:after {
2015-07-08 19:47:45 +08:00
position: absolute;
2015-07-09 21:05:33 +08:00
width: 18px;
height: 18px;
left: 2px;
2015-11-26 19:32:55 +08:00
top: 1px;
2015-07-13 16:51:56 +08:00
border-radius: 100%;
2015-08-20 16:55:42 +08:00
background-color: #fff;
2015-07-08 19:47:45 +08:00
content: " ";
cursor: pointer;
2015-07-17 17:21:04 +08:00
transition: left @switch-duration @ease-in-out-circ;
2015-07-08 19:47:45 +08:00
}
2015-12-06 16:39:01 +08:00
&-small {
height: 14px;
line-height: 12px;
2015-12-09 16:40:50 +08:00
width: 28px;
2015-12-06 16:39:01 +08:00
&:after {
width: 12px;
height: 12px;
top: 0;
2015-12-09 16:40:50 +08:00
left: 0;
2015-12-06 16:39:01 +08:00
}
}
&-small&-checked:after {
2015-12-09 16:40:50 +08:00
left: 14px;
2015-12-06 16:39:01 +08:00
}
2015-11-26 19:32:55 +08:00
&-checked {
2015-08-11 21:25:25 +08:00
border: 1px solid @primary-color;
background-color: @primary-color;
2015-07-09 21:05:33 +08:00
2015-08-20 16:55:42 +08:00
.@{switch-prefix-cls}-inner {
2015-11-26 19:32:55 +08:00
left: 6px;
2015-07-09 21:05:33 +08:00
}
2015-07-08 19:47:45 +08:00
2015-11-26 19:32:55 +08:00
&:after {
2015-07-09 21:05:33 +08:00
left: 22px;
2015-07-08 19:47:45 +08:00
}
}
2015-11-26 19:32:55 +08:00
&-disabled {
cursor: not-allowed;
2015-07-16 13:00:56 +08:00
background: #f4f4f4;
2015-11-26 19:32:55 +08:00
border-color: #f4f4f4;
2015-07-08 19:47:45 +08:00
2015-11-26 19:32:55 +08:00
&:after {
2015-07-16 13:00:56 +08:00
background: #ccc;
cursor: not-allowed;
2015-07-08 19:47:45 +08:00
}
2015-07-16 13:00:56 +08:00
&-inner {
2015-11-26 19:32:55 +08:00
color: #ccc;
2015-07-16 13:00:56 +08:00
}
2015-07-08 19:47:45 +08:00
}
}