feat: change default theme from system to light mode

This commit is contained in:
Graham McIntire 2026-06-23 10:28:31 -05:00
parent b76637c14f
commit 785f077c50
2 changed files with 2 additions and 2 deletions

View file

@ -340,7 +340,7 @@ const ThemeSelector = {
window.addEventListener("phx:set-theme", () => this.updateActive())
},
updateActive() {
const current = localStorage.getItem("phx:theme") || "system"
const current = localStorage.getItem("phx:theme") || "light"
this.el.querySelectorAll<HTMLElement>("[data-phx-theme]").forEach((btn) => {
const isActive = btn.dataset.phxTheme === current
btn.setAttribute("aria-pressed", isActive ? "true" : "false")

View file

@ -52,7 +52,7 @@
const getSystemTheme = () => mql.matches ? "dark" : "light";
const applyTheme = () => {
const preference = localStorage.getItem("phx:theme") || "system";
const preference = localStorage.getItem("phx:theme") || "light";
const theme = preference === "system" ? getSystemTheme() : preference;
document.documentElement.setAttribute("data-theme", theme);
};