what the helk!?

This commit is contained in:
Ashley Graves 2024-10-15 15:09:04 +02:00
parent 7c210ee7a6
commit bfb14f4b15
14 changed files with 771 additions and 3 deletions

View file

@ -0,0 +1,9 @@
// Set theme to the user's preferred color scheme
function updateTheme() {
const colorMode = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
document.querySelector("html").setAttribute("data-bs-theme", colorMode);
}
updateTheme()
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', updateTheme)