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:
@@ -30,7 +30,11 @@
|
||||
-->
|
||||
<title>{{ title }}</title>
|
||||
|
||||
<script>document.documentElement.className = 'js-enabled';</script>
|
||||
<style>
|
||||
.js-enabled #root > * {
|
||||
visibility: hidden;
|
||||
}
|
||||
html {
|
||||
overflow-y: scroll;
|
||||
}
|
||||
@@ -41,6 +45,18 @@
|
||||
</head>
|
||||
|
||||
<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 class="container menu">
|
||||
<p>
|
||||
|
||||
Reference in New Issue
Block a user