feat(web): mount ThemeSwitch in header + pre-paint theme init (#59)
This commit is contained in:
@@ -4,6 +4,16 @@
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Collection</title>
|
||||
<script>
|
||||
try {
|
||||
var t = localStorage.getItem("theme") || "system";
|
||||
var dark =
|
||||
t === "dark" ||
|
||||
(t === "system" &&
|
||||
window.matchMedia("(prefers-color-scheme: dark)").matches);
|
||||
document.documentElement.classList.toggle("dark", dark);
|
||||
} catch (e) {}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
Reference in New Issue
Block a user