theme blink bug fixed
This commit is contained in:
parent
e050e0f374
commit
b82244ab9b
|
@ -2,7 +2,6 @@ $(document).ready(function() {
|
|||
// theme change
|
||||
var localTheme = localStorage.getItem('theme');
|
||||
if (localTheme) {
|
||||
$('#root').attr('class', `theme__${localTheme}`);
|
||||
$('.select-theme__item').each(function () {
|
||||
$(this).removeClass('is-active');
|
||||
});
|
||||
|
|
|
@ -13,6 +13,12 @@
|
|||
</head>
|
||||
|
||||
<body id="root" class="theme__{{ index .Site.Params.themeOptions 0 }}">
|
||||
<script>
|
||||
var localTheme = localStorage.getItem('theme');
|
||||
if (localTheme) {
|
||||
document.getElementById('root').className = `theme__${localTheme}`;
|
||||
}
|
||||
</script>
|
||||
<div id="body">
|
||||
<div class="container wrapper">
|
||||
{{ partial "navbar/site-nav" . }}
|
||||
|
|
Loading…
Reference in New Issue