forked from zmc/pulpito-ng
-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.html
43 lines (39 loc) · 1.28 KB
/
index.html
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
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="Pulpito" />
<link rel="apple-touch-icon" href="/favicon.ico" />
<link rel="manifest" href="/manifest.json" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
<style>
body:where([color-scheme="dark"]) {
background-color: rgb(24, 24, 24);
}
body:where([color-scheme="light"]) {
background-color: white;
}
</style>
<title>Pulpito</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script>
try {
let colorScheme = localStorage.getItem("theme");
const systemDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches;
if (!colorScheme) {
colorScheme = systemDarkMode ? "dark" : "light";
}
if (!!colorScheme) localStorage.setItem("theme", colorScheme);
document.getElementsByTagName("body")[0].setAttribute("color-scheme", colorScheme);
} catch (e) {
console.error(e);
}
</script>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>