Merge pull request #421 from satelllte/theme_flicker_fix

This commit is contained in:
Patricio Gonzalez Vivo 2024-09-29 10:43:25 -04:00 committed by GitHub
commit b9d2b44db0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -3,6 +3,12 @@
<footer>
<p> Copyright 2015 <a href="http://www.patriciogonzalezvivo.com" target="_blank">Patricio Gonzalez Vivo</a> </p>
</footer>
<script type="text/javascript">
// Setting the theme immediately inside the inline script prevents flicker
document.body.dataset.theme = localStorage.getItem('theme') || 'light';
</script>
<?php
echo '
<script type="text/javascript" src="'.$path.'/src/main.js" defer></script>';