83 lines
1.3 KiB
SCSS
83 lines
1.3 KiB
SCSS
.Switcher {
|
|
position: relative;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
margin: 0;
|
|
|
|
&.disabled {
|
|
pointer-events: none;
|
|
opacity: 0.5;
|
|
}
|
|
|
|
&.inactive {
|
|
pointer-events: none;
|
|
}
|
|
|
|
body.no-page-transitions &,
|
|
&.no-animation {
|
|
.widget,
|
|
.widget::after {
|
|
transition: none !important;
|
|
}
|
|
|
|
.widget:active:after {
|
|
width: 1.125rem;
|
|
}
|
|
}
|
|
|
|
input {
|
|
position: absolute;
|
|
z-index: var(--z-below);
|
|
|
|
width: 0;
|
|
height: 0;
|
|
|
|
visibility: hidden;
|
|
opacity: 0;
|
|
}
|
|
|
|
.widget {
|
|
cursor: var(--custom-cursor, pointer);
|
|
|
|
position: relative;
|
|
|
|
display: inline-block;
|
|
|
|
width: 2.125rem;
|
|
height: 0.875rem;
|
|
border-radius: 0.5rem;
|
|
|
|
text-indent: -999px;
|
|
|
|
background-color: var(--color-gray);
|
|
|
|
transition: background-color 150ms;
|
|
}
|
|
|
|
.widget:after {
|
|
content: "";
|
|
|
|
position: absolute;
|
|
top: -0.125rem;
|
|
left: 0;
|
|
|
|
width: 1.125rem;
|
|
height: 1.125rem;
|
|
border: 0.125rem solid var(--color-gray);
|
|
border-radius: 0.75rem;
|
|
|
|
background-color: var(--color-background);
|
|
|
|
transition: transform 200ms;
|
|
}
|
|
|
|
input:checked + .widget {
|
|
background: var(--color-primary);
|
|
}
|
|
|
|
input:checked + .widget:after {
|
|
transform: translateX(100%);
|
|
border-color: var(--color-primary);
|
|
}
|
|
}
|