77 lines
No EOL
1.3 KiB
CSS
77 lines
No EOL
1.3 KiB
CSS
/* TOGGLE */
|
|
.toggle {
|
|
position: relative;
|
|
display: inline-block;
|
|
width: 48px;
|
|
height: 26px;
|
|
}
|
|
|
|
.toggle input {
|
|
opacity: 0;
|
|
width: 0;
|
|
height: 0;
|
|
}
|
|
|
|
.slider {
|
|
position: absolute;
|
|
cursor: pointer;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
background-color: var(--color-void-300);
|
|
transition: .3s;
|
|
border-radius: 34px;
|
|
}
|
|
|
|
.slider:before {
|
|
position: absolute;
|
|
content: "";
|
|
height: 20px;
|
|
width: 20px;
|
|
left: 3px;
|
|
bottom: 3px;
|
|
background-color: white;
|
|
transition: .3s;
|
|
border-radius: 50%;
|
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
|
}
|
|
|
|
.toggle input:checked+.slider {
|
|
background-color: var(--color-cyan-500);
|
|
}
|
|
|
|
.toggle input:checked+.slider:before {
|
|
transform: translateX(22px);
|
|
}
|
|
|
|
/* TOGGLE SWITCH (Custom Div Based) */
|
|
.toggle-switch {
|
|
width: 48px;
|
|
height: 24px;
|
|
background: var(--color-void-300);
|
|
border-radius: 99px;
|
|
position: relative;
|
|
cursor: pointer;
|
|
transition: all 0.3s;
|
|
}
|
|
|
|
.toggle-switch::after {
|
|
content: '';
|
|
position: absolute;
|
|
top: 2px;
|
|
left: 2px;
|
|
width: 20px;
|
|
height: 20px;
|
|
background: white;
|
|
border-radius: 50%;
|
|
transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
|
|
}
|
|
|
|
.toggle-switch.active {
|
|
background: var(--color-cyan-500);
|
|
}
|
|
|
|
.toggle-switch.active::after {
|
|
transform: translateX(24px);
|
|
} |