fix: Prevent content and dark mode background flashes on load

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
2026-01-02 20:44:10 +00:00
parent 7b978cac43
commit 407c995d9f

View File

@@ -30,7 +30,11 @@
--> -->
<title>{{ title }}</title> <title>{{ title }}</title>
<script>document.documentElement.className = 'js-enabled';</script>
<style> <style>
.js-enabled #root > * {
visibility: hidden;
}
html { html {
overflow-y: scroll; overflow-y: scroll;
} }
@@ -41,6 +45,18 @@
</head> </head>
<body> <body>
<script>
(function() {
try {
var theme = localStorage.getItem('theme');
if (theme === 'dark') {
document.body.style.backgroundColor = '#1a1a1a';
} else if (theme === 'black' || theme === 'red') {
document.body.style.backgroundColor = '#000';
}
} catch (e) {}
})();
</script>
<div id="root"> <div id="root">
<div class="container menu"> <div class="container menu">
<p> <p>