theme: prevent flicker on first load
This commit is contained in:
parent
188740129d
commit
a6f2950a2a
|
|
@ -3,6 +3,12 @@
|
||||||
<footer>
|
<footer>
|
||||||
<p> Copyright 2015 <a href="http://www.patriciogonzalezvivo.com" target="_blank">Patricio Gonzalez Vivo</a> </p>
|
<p> Copyright 2015 <a href="http://www.patriciogonzalezvivo.com" target="_blank">Patricio Gonzalez Vivo</a> </p>
|
||||||
</footer>
|
</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
|
<?php
|
||||||
echo '
|
echo '
|
||||||
<script type="text/javascript" src="'.$path.'/src/main.js" defer></script>';
|
<script type="text/javascript" src="'.$path.'/src/main.js" defer></script>';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue