-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
25 lines (25 loc) · 943 Bytes
/
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Michał Nieruchalski</title>
<base href="/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<link rel="stylesheet" href="/src/styles.css" />
<script>
/* the script is put here to avoid flickering on first load */
const THEME_MODE_STORAGE_KEY = 'theme_mode_storage_key';
const DARK_MODE_CLASS = 'dark-mode';
const isSystemDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
const storedItem = localStorage.getItem(THEME_MODE_STORAGE_KEY);
if (storedItem === 'dark' || (!storedItem && isSystemDark)) {
document.documentElement.classList.add(DARK_MODE_CLASS);
}
</script>
</head>
<body>
<app-root></app-root>
<script type="module" src="/src/main.ts"></script>
</body>
</html>