Set last known app theme background color until theme is loaded
This commit is contained in:
13
index.html
13
index.html
@@ -28,6 +28,19 @@
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="./src/index.tsx"></script>
|
||||
<script>
|
||||
const backgroundColor = (() => {
|
||||
try {
|
||||
return JSON.parse(window.localStorage.getItem("theme_background"))
|
||||
} catch (e) {
|
||||
return null
|
||||
}
|
||||
})();
|
||||
|
||||
if (backgroundColor) {
|
||||
document.documentElement.style.backgroundColor = backgroundColor;
|
||||
}
|
||||
</script>
|
||||
<!--
|
||||
This HTML file is a template.
|
||||
If you open it directly in the browser, you will see an empty page.
|
||||
|
||||
Reference in New Issue
Block a user