@mdsfe/mds-ui
Version:
A set of enterprise-class Vue UI components.
111 lines (110 loc) • 2.46 kB
CSS
/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
/* stylelint-disable declaration-bang-space-before */
/* stylelint-disable declaration-bang-space-before */
.mds-switch {
position: relative;
display: inline-block;
box-sizing: border-box;
height: 28px;
min-width: 56px;
line-height: 26px;
vertical-align: middle;
border-radius: 20px;
border: 1px solid transparent;
background-color: rgba(0, 0, 0, 0.2);
cursor: pointer;
transition: all 0.36s;
user-select: none;
}
.mds-switch-inner {
color: #fff;
font-size: 12px;
margin-left: 32px;
margin-right: 6px;
display: block;
}
.mds-switch:after {
position: absolute;
width: 24px;
height: 24px;
left: 1px;
top: 1px;
border-radius: 18px;
background-color: #fff;
box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.15);
content: " ";
cursor: pointer;
transition: all 0.36s;
}
.mds-switch:active:after {
width: 24px;
}
.mds-switch:focus {
box-shadow: 0 0 0 2px rgba(3, 100, 255, 0.2);
outline: 0;
}
.mds-switch:focus:hover {
box-shadow: none;
}
.mds-switch-small {
height: 24px;
min-width: 44px;
line-height: 24px;
}
.mds-switch-small .mds-switch-inner {
margin-left: 24px;
margin-right: 6px;
}
.mds-switch-small:after {
width: 20px;
height: 20px;
top: 1px;
left: 0.5px;
}
.mds-switch-small:active:after {
width: 16px;
}
.mds-switch-small.mds-switch-checked:after {
left: 100%;
margin-left: -20.5px;
}
.mds-switch-small.mds-switch-checked .mds-switch-inner {
margin-left: 6px;
margin-right: 18px;
}
.mds-switch-small:active.mds-switch-checked:after {
margin-left: -16.5px;
}
.mds-switch-checked {
background-color: #0364FF;
}
.mds-switch-checked .mds-switch-inner {
margin-left: 10px;
margin-right: 24px;
}
.mds-switch-checked:after {
left: 100%;
margin-left: -24px;
box-shadow: 0px 2px 4px 0px #063a8d;
}
.mds-switch-checked:active:after {
margin-left: -25px;
}
.mds-switch-disabled {
cursor: not-allowed;
background: #EEEEEE;
}
.mds-switch-disabled:after {
background: #fff;
cursor: not-allowed;
}
.mds-switch-disabled .mds-switch-inner {
color: rgba(0, 0, 0, 0.2);
}
.mds-switch-disabled.mds-switch-checked {
cursor: not-allowed;
background: #cfe2ff;
}
/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
/* stylelint-disable declaration-bang-space-before */
/* stylelint-disable declaration-bang-space-before */