waveterm/frontend/app/element/toggle.scss
Evan Simkowitz 2e91ee843c
Switch from Less to Scss (#1335)
Less hasn't received an update in over a year and the parser is missing
some modern syntax like relative colors so this switches us to scss
2024-11-21 16:05:04 -08:00

63 lines
1.3 KiB
SCSS

// Copyright 2024, Command Line Inc.
// SPDX-License-Identifier: Apache-2.0
.check-toggle-wrapper {
user-select: none;
display: flex;
height: 100%;
align-items: center;
justify-content: center;
.checkbox-toggle {
position: relative;
display: inline-block;
width: 32px;
height: 20px;
input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
content: "";
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: var(--toggle-bg-color);
transition: 0.5s;
border-radius: 33px;
}
.slider:before {
position: absolute;
content: "";
height: 16px;
width: 16px;
left: 3px;
bottom: 2px;
background-color: var(--toggle-thumb-color);
transition: 0.5s;
border-radius: 50%;
}
input:checked + .slider {
background-color: var(--toggle-checked-bg-color);
}
input:checked + .slider:before {
transform: translateX(11px);
}
}
label,
.toggle-label {
cursor: pointer;
padding: 0 5px;
}
}