From 9ed60982ddc2245f9d362638e45e019cda4fadce Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Fri, 7 Aug 2026 08:42:35 -0400 Subject: [PATCH] fix: default theme to dark Amp-Thread-ID: https://ampcode.com/threads/T-019fd7ad-db1c-77c3-a4a5-ded3e7c88e7c Co-authored-by: Amp --- src/components/ThemeSetting.astro | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/components/ThemeSetting.astro b/src/components/ThemeSetting.astro index 591d7b4..f8d7fd1 100644 --- a/src/components/ThemeSetting.astro +++ b/src/components/ThemeSetting.astro @@ -3,12 +3,6 @@ const toggles = () => document.querySelectorAll(".theme-toggle"); const initializedToggles = new Set(); - function getThemePreference() { - return matchMedia("(prefers-color-scheme: dark)").matches - ? "dark" - : "light"; - } - function updateElementsForTheme(newTheme: string | string) { if (!newTheme || newTheme === "light") { html().classList.remove("dark"); @@ -27,7 +21,7 @@ ? (localStorage.getItem("theme") as string) : undefined; - const theme = startingTheme ?? getThemePreference(); + const theme = startingTheme ?? "dark"; updateElementsForTheme(theme);