From 785f077c50fec2b1a84021e2a42e68bbaf21c64d Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Tue, 23 Jun 2026 10:28:31 -0500 Subject: [PATCH] feat: change default theme from system to light mode --- assets/js/app.ts | 2 +- lib/towerops_web/components/layouts/root.html.heex | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/js/app.ts b/assets/js/app.ts index 9f1b85ab..145c6598 100644 --- a/assets/js/app.ts +++ b/assets/js/app.ts @@ -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("[data-phx-theme]").forEach((btn) => { const isActive = btn.dataset.phxTheme === current btn.setAttribute("aria-pressed", isActive ? "true" : "false") diff --git a/lib/towerops_web/components/layouts/root.html.heex b/lib/towerops_web/components/layouts/root.html.heex index 870621ac..6deb7608 100644 --- a/lib/towerops_web/components/layouts/root.html.heex +++ b/lib/towerops_web/components/layouts/root.html.heex @@ -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); };