osnova 2
This commit is contained in:
5
scripts/preload.js
Normal file
5
scripts/preload.js
Normal file
@@ -0,0 +1,5 @@
|
||||
(function() {
|
||||
const saved = localStorage.getItem('theme') || 'light';
|
||||
const osPref = matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
||||
document.documentElement.setAttribute('data-theme', saved ?? osPref);
|
||||
})();
|
||||
Reference in New Issue
Block a user