File size: 925 Bytes
ea775bd | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | .switch {
position: relative;
display: inline-block;
width: 36px;
height: 20px;
}
.switch-input {
opacity: 0;
width: 0;
height: 0;
}
.switch-slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(37, 72, 120, 0.14);
transition: 0.2s;
border-radius: 20px;
}
.switch-slider:before {
position: absolute;
content: "";
height: 16px;
width: 16px;
left: 2px;
bottom: 2px;
background-color: white;
transition: 0.2s;
border-radius: 50%;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.switch-input:checked + .switch-slider {
background-color: var(--primary);
}
.switch-input:focus-visible + .switch-slider {
box-shadow: 0 0 0 2px rgba(20, 112, 255, 0.38);
}
.switch-input:checked + .switch-slider:before {
transform: translateX(16px);
}
.switch-input:disabled + .switch-slider {
opacity: 0.5;
cursor: not-allowed;
}
|