Files
douyi_guaji_main/webui/js/theme_bootstrap.js
T

14 lines
377 B
JavaScript

(function () {
try {
var saved = localStorage.getItem("ui-theme");
var theme =
saved === "dark" || saved === "light"
? saved
: window.matchMedia &&
window.matchMedia("(prefers-color-scheme: dark)").matches
? "dark"
: "light";
document.documentElement.setAttribute("data-theme", theme);
} catch (e) {}
})();