Files
opencode2api/webui/js/theme-init.js
T
Jason Xu e2b2a7c281 refactor: harden gateway and document Go/Zen OAuth
Preserve Go and Zen OAuth routing while fixing authentication, secret redaction, streaming, transport, and configuration issues.

Refresh README and management guides in four languages while preserving sponsors, LinuxDo acknowledgements, and Linux/Docker quick start instructions.
2026-11-18 03:01:56 +08:00

12 lines
452 B
JavaScript

// Apply the theme before first paint while honoring the script-src policy.
// The theme module owns changes after the console starts.
(() => {
try {
const mode = localStorage.getItem("opencode2api.ui.theme") || "auto";
const dark =
mode === "dark" ||
(mode === "auto" && matchMedia("(prefers-color-scheme: dark)").matches);
document.documentElement.setAttribute("data-theme", dark ? "dark" : "light");
} catch (_) {}
})();