fix not working in prod

This commit is contained in:
2023-07-27 12:26:25 +02:00
parent 8fc62c8265
commit 03c6445ebf

View File

@@ -1,13 +1,10 @@
let theme = '';
theme = sessionStorage.getItem( 'theme' ) || getPreferredTheme();
$( document ).ready( function () {
$( '#nav' ).load( '/docs/nav.html' );
$( '#top' ).load( '/docs/top.html' );
} );
// set theme on page load
theme = localStorage.getItem( 'theme' ) ?? '';
let theme = localStorage.getItem( 'theme' ) ?? '';
if ( window.matchMedia( '(prefers-color-scheme: dark)' ).matches || theme === 'dark' ) {
document.documentElement.classList.add( 'dark' );
setTimeout( () => {