remove in-line script from header

This commit is contained in:
David G. Simmons 2024-10-21 09:35:54 -04:00
parent aa9b49b318
commit 502aaa7148
No known key found for this signature in database
GPG key ID: 3E0F418F1D0ABB96
2 changed files with 12 additions and 0 deletions

View file

@ -1,2 +1,3 @@
export * from './device'
export * from './insertScript'
export * from './theme-scheme'

View file

@ -0,0 +1,11 @@
let theme = localStorage.getItem('theme-scheme') || localStorage.getItem('darkmode:color-scheme') || 'light'
const b = 'bollocks!';
console.log(b);
if (theme === 'system') {
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
theme = 'dark'
} else {
theme = 'light'
}
}
document.documentElement.setAttribute('data-theme', theme)