Files
Work/Frontend/src/components/shell/TopBar/ThemeToggle.module.scss
2026-06-16 13:11:14 +01:00

69 lines
1.3 KiB
SCSS

.toggleButton {
display: inline-flex;
justify-content: center;
align-items: center;
width: 2.75rem;
height: 2.75rem;
aspect-ratio: 1;
padding: 0;
border: 0;
border-radius: 999px;
flex-shrink: 0;
cursor: pointer;
background: transparent;
color: var(--color-text-muted);
transition:
background-color 500ms ease,
color 220ms var(--easing-standard),
transform 180ms var(--easing-standard);
}
.toggleButton:hover {
background: color-mix(in srgb, var(--color-text) 8%, transparent);
color: var(--color-text);
}
.toggleButton:focus-visible {
outline: none;
background: color-mix(in srgb, var(--color-accent-strong) 12%, transparent);
box-shadow: 0 0 0 0.12rem color-mix(in srgb, var(--color-accent-strong) 28%, transparent);
color: var(--color-text);
}
.iconContainer {
position: relative;
width: 1.375rem;
height: 1.375rem;
}
.iconLayer {
position: absolute;
inset: 0;
display: inline-flex;
align-items: center;
justify-content: center;
transition:
transform 1000ms ease,
opacity 500ms ease;
}
.moonLayer {
transform: rotate(90deg);
opacity: 0;
:global([data-theme="dark"]) & {
transform: rotate(0deg);
opacity: 1;
}
}
.sunLayer {
transform: rotate(0deg);
opacity: 1;
:global([data-theme="dark"]) & {
transform: rotate(-90deg);
opacity: 0;
}
}