Files
ferrum/web/public/theme-init.js
T
Anand 30893aecc4 Redesign UI as Glass Flight Deck (aviation instrument-panel theme)
Flattened radii to instrument-panel bezels, retuned the caution color
hierarchy, replaced glossy gradients with flat panel surfaces, added a
persistent master-caution bar, condensed Oswald display type, corner-frame
targeting brackets on instrument tiles, and a blueprint grid ground.
2026-09-03 12:10:17 +05:30

15 lines
674 B
JavaScript

// Runs before first paint so returning dark-mode users never see a light
// flash. Kept as an external file so the CSP (script-src 'self') stays
// free of inline-script allowances.
(function () {
try {
var stored = localStorage.getItem("ferrum-theme");
var dark = stored === "dark" || (stored !== "light" && window.matchMedia("(prefers-color-scheme: dark)").matches);
if (dark) document.documentElement.classList.add("dark");
var meta = document.querySelector('meta[name="theme-color"]');
if (meta) meta.setAttribute("content", dark ? "#090b0e" : "#ffffff");
} catch {
/* no storage / no matchMedia — default light theme applies */
}
})();