chore: update deps

This commit is contained in:
Cory Dransfeldt 2024-10-30 17:06:54 -07:00
parent bc561bcb27
commit 75882730b2
No known key found for this signature in database
4 changed files with 38 additions and 16 deletions

View file

@ -53,8 +53,13 @@
document.querySelector("theme-toggle")?.getAttribute("storage") === "local"
? localStorage
: sessionStorage;
const currentTheme = storageType.getItem("theme") || "auto";
const metaColorScheme = document.querySelector('meta[name="color-scheme"]');
const lightIcon = document.querySelector(".light");
const darkIcon = document.querySelector(".dark");
const autoIcon = document.querySelector(".auto");
if (currentTheme === "auto") {
metaColorScheme.setAttribute("content", "light dark");
document.documentElement.style.colorScheme = "";
@ -62,6 +67,18 @@
metaColorScheme.setAttribute("content", currentTheme);
document.documentElement.style.colorScheme = currentTheme;
}
lightIcon.style.display = "none";
darkIcon.style.display = "none";
autoIcon.style.display = "none";
if (currentTheme === "light") {
lightIcon.style.display = "inline";
} else if (currentTheme === "dark") {
darkIcon.style.display = "inline";
} else {
autoIcon.style.display = "inline";
}
})();
</script>
<div class="main-wrapper">