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>
|
<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>
|
||||||
|
|||||||
Reference in New Issue
Block a user