acud
Version:
acg react 组件库
216 lines (215 loc) • 4.26 kB
CSS
/* color */
/* 默认颜色 */
/* 通用-icon */
/* 标签 */
/* 默认颜色 */
/* 其他颜色 */
/* 通用 */
/* 水平 */
/* 垂直 */
/* 序号水平 */
/* 序号垂直 */
.acud-switch {
position: relative;
display: inline-block;
box-sizing: border-box;
width: 44px;
height: 20px;
padding: 0;
line-height: 18px;
vertical-align: middle;
color: #FFFFFF;
background-color: #D4D6D9;
border-color: transparent;
border-style: solid;
border-width: 1px;
border-radius: 22px;
cursor: pointer;
transition: all 0.3s cubic-bezier(0.35, 0, 0.25, 1);
}
.acud-switch:hover {
color: #FFFFFF;
}
.acud-switch:active {
color: #FFFFFF;
}
.acud-switch[disabled],
.acud-switch[disabled]:hover,
.acud-switch[disabled]:active {
color: #B8BABF;
}
.acud-switch:hover {
background-color: #B8BABF;
}
.acud-switch:active {
background-color: #B8BABF;
}
.acud-switch[disabled],
.acud-switch[disabled]:hover,
.acud-switch[disabled]:active {
background-color: #F2F2F4;
}
.acud-switch:hover {
border-color: transparent;
}
.acud-switch:active {
border-color: transparent;
}
.acud-switch[disabled],
.acud-switch[disabled]:hover,
.acud-switch[disabled]:active {
border-color: transparent;
}
.acud-switch-inner {
position: absolute;
top: 0;
left: 22px;
display: flex;
align-items: center;
height: 100%;
font-size: 12px;
}
.acud-switch-inner .acudicon {
line-height: 0;
}
.acud-switch:after {
position: absolute;
top: 1px;
left: 2px;
width: 16px;
height: 16px;
border-radius: 8px 8px;
background-color: #FFFFFF;
cursor: pointer;
transition: left 0.3s cubic-bezier(0.35, 0, 0.25, 1);
animation-name: switchOff;
animation-duration: 0.3s;
animation-timing-function: cubic-bezier(0.35, 0, 0.25, 1);
content: " ";
}
.acud-switch:active:after {
width: 20px;
animation-name: switchOn;
}
.acud-switch:focus {
outline: none;
}
.acud-switch-checked {
border-style: solid;
border-width: 1px;
color: #FFFFFF;
background-color: #2468F2;
border-color: transparent;
}
.acud-switch-checked:hover {
color: #FFFFFF;
}
.acud-switch-checked:active {
color: #FFFFFF;
}
.acud-switch-checked[disabled],
.acud-switch-checked[disabled]:hover,
.acud-switch-checked[disabled]:active {
color: #FFFFFF;
}
.acud-switch-checked:hover {
background-color: #144BCC;
}
.acud-switch-checked:active {
background-color: #144BCC;
}
.acud-switch-checked[disabled],
.acud-switch-checked[disabled]:hover,
.acud-switch-checked[disabled]:active {
background-color: #D4E5FF;
}
.acud-switch-checked:hover {
border-color: transparent;
}
.acud-switch-checked:active {
border-color: transparent;
}
.acud-switch-checked[disabled],
.acud-switch-checked[disabled]:hover,
.acud-switch-checked[disabled]:active {
border-color: transparent;
}
.acud-switch-checked .acud-switch-inner {
left: 6px;
}
.acud-switch-checked:after {
left: initial;
right: 2px;
}
.acud-switch-checked[disabled]:after {
background-color: #FFFFFF;
}
.acud-switch-checked[disabled].acud-switch-loading .acud-switch-loading-icon {
color: #D4E5FF;
}
.acud-switch-checked.acud-switch-loading .acud-switch-loading-icon {
color: #2468F2;
left: initial;
right: 2px;
}
.acud-switch-loading {
cursor: no-drop;
}
.acud-switch-loading:after {
cursor: no-drop;
animation-name: none;
}
.acud-switch-loading:hover:after {
width: 16px;
animation-name: none;
}
.acud-switch-loading .acud-switch-loading-icon {
position: absolute;
top: 1px;
z-index: 99;
color: #D4D6D9;
left: 2px;
}
.acud-switch-disabled {
cursor: no-drop;
}
.acud-switch-disabled:after {
cursor: no-drop;
animation-name: none;
background-color: #D4D6D9;
}
.acud-switch-disabled:hover:after {
width: 16px;
animation-name: none;
}
.acud-switch-disabled .acud-switch-loading-icon {
color: #F2F2F4;
}
.acud-switch-label {
display: inline-block;
padding-left: 10px;
font-size: 14px;
line-height: 20px;
white-space: normal;
vertical-align: middle;
-webkit-user-select: text;
-moz-user-select: text;
user-select: text;
pointer-events: none;
}
@keyframes switchOn {
0% {
width: 16px;
}
100% {
width: 20px;
}
}
@keyframes switchOff {
0% {
transform: scale(1.1);
}
100% {
transform: scale(1);
}
}