remove in-line script from header
This commit is contained in:
parent
aa9b49b318
commit
502aaa7148
2 changed files with 12 additions and 0 deletions
|
@ -1,2 +1,3 @@
|
|||
export * from './device'
|
||||
export * from './insertScript'
|
||||
export * from './theme-scheme'
|
||||
|
|
11
assets/scripts/core/theme-scheme.js
Normal file
11
assets/scripts/core/theme-scheme.js
Normal 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)
|
Loading…
Add table
Add a link
Reference in a new issue