-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
34 lines (31 loc) · 1.21 KB
/
Copy pathindex.html
File metadata and controls
34 lines (31 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>DS4 Dashboard</title>
<script>
// Runs synchronously, before the browser paints anything, so the correct
// theme's CSS variables (see theme.css) are active from the very first
// frame. Without this, `:root`'s light-theme values are what's active
// until React mounts and ThemeContext's effect (necessarily async, runs
// after first paint) sets data-theme -- a real flash of the wrong theme
// on every launch, not just a dev-server quirk. Keep this in sync with
// ThemeContext.jsx's applyTheme().
(function () {
var theme = localStorage.getItem("theme") || "system_default";
var target = theme === "system_default"
? (window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light")
: theme;
var root = document.documentElement;
root.setAttribute("data-theme", target);
root.classList.add(target);
})();
</script>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>