fix(panel): reactive system theme detection
This commit is contained in:
5 files changed
+86
-92
No files matched your search
+1
-2
@@ -6,8 +6,7 @@
|
||||
<title>Felis · Control Panel</title>
|
||||
<script>
|
||||
try {
|
||||
const theme = localStorage.getItem("felis-theme") || "system";
|
||||
const dark = theme === "dark" || (theme === "system" && window.matchMedia("(prefers-color-scheme: dark)").matches);
|
||||
const dark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
||||
if (dark) {
|
||||
document.documentElement.classList.add("dark");
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user