-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
33 lines (30 loc) · 1.21 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
<!doctype html>
<html class="h-full light" data-theme="true" lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/media/app/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Metronic Tailwind React</title>
</head>
<body class="antialiased flex h-full demo1 sidebar-fixed header-fixed bg-[#fefefe] dark:bg-coal-500">
<script>
const defaultThemeMode = 'light'; // light|dark|system
let themeMode;
if ( document.documentElement ) {
if ( localStorage.getItem('theme')) {
themeMode = localStorage.getItem('theme');
} else if ( document.documentElement.hasAttribute('data-theme-mode')) {
themeMode = document.documentElement.getAttribute('data-theme-mode');
} else {
themeMode = defaultThemeMode;
}
if (themeMode === 'system') {
themeMode = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
}
document.documentElement.classList.add(themeMode);
}
</script>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>