add dark theme

This commit is contained in:
2026-07-31 23:15:33 +05:00
parent e90199803d
commit 46f88ca04c
4 changed files with 85 additions and 10 deletions
+14
View File
@@ -5,6 +5,20 @@
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>RADIUS Admin</title>
<!-- Critical: paint the correct background before the app CSS loads (avoids flash). -->
<style>
html { background: oklch(1 0 0); color-scheme: light; }
html.dark { background: oklch(0.145 0 0); color-scheme: dark; }
</style>
<script>
// Apply saved (or system) theme before first paint.
(function () {
var t = localStorage.getItem('radui.theme')
if (t === 'dark' || (!t && matchMedia('(prefers-color-scheme: dark)').matches)) {
document.documentElement.classList.add('dark')
}
})()
</script>
</head>
<body>
<div id="root"></div>