web: vite + react + tailwind hello page with dark-mode toggle
Workspace packages export TS source under a 'source' condition used by vite, node (--conditions=source) and tsc. Task: M0-T4
This commit is contained in:
1 parent
08bd33eefa
commit
d12795ec8b
11 files changed
+581
-47
No files matched your search
@@ -0,0 +1,20 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>SelfPhoneNG</title>
|
||||
<script>
|
||||
// Apply the theme before first paint so dark mode doesn't flash.
|
||||
try {
|
||||
const t = localStorage.getItem('theme');
|
||||
if (t === 'dark' || (!t && matchMedia('(prefers-color-scheme: dark)').matches))
|
||||
document.documentElement.classList.add('dark');
|
||||
} catch {}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user