Update theme toggle mechanism

This commit is contained in:
kritzl 2025-03-03 16:40:30 +01:00
commit 246417a553
Signed by: kritzl
SSH key fingerprint: SHA256:5BmINP9VjZWaUk5Z+2CTut1KFhwLtd0ZynMekKbtViM
15 changed files with 425 additions and 200 deletions

View file

@ -208,18 +208,29 @@ $mobile-navigation-height: 4rem;
@include theme_light();
}
html,
html.light {
@include theme_light();
}
html.dark {
@include theme_dark();
}
@media (prefers-color-scheme: dark) {
html {
@include theme_dark();
&:has(#themeLight:checked) {
@include theme_light();
}
}
#themeToggleDark {
display: none;
}
}
@media (prefers-color-scheme: light) {
html {
@include theme_light();
&:has(#themeDark:checked) {
@include theme_dark();
}
}
#themeToggleLight {
display: none;
}
}