moved packages out of pkg
This commit is contained in:
15
internal/embedfs/web/js/theme.js
Normal file
15
internal/embedfs/web/js/theme.js
Normal file
@@ -0,0 +1,15 @@
|
||||
// This function prevents the 'flash of unstyled content'
|
||||
// Include it at the top of <head>
|
||||
(function() {
|
||||
let theme = localStorage.getItem("theme") || "system";
|
||||
if (theme === "system") {
|
||||
theme = window.matchMedia("(prefers-color-scheme: dark)").matches
|
||||
? "dark"
|
||||
: "light";
|
||||
}
|
||||
if (theme === "dark") {
|
||||
document.documentElement.classList.add("dark");
|
||||
} else {
|
||||
document.documentElement.classList.remove("dark");
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user