* remove in-line script from header * oops! * Set script in-line with integrity hash Signed-off-by: Emruz Hossain <hossainemruz@gmail.com> --------- Signed-off-by: Emruz Hossain <hossainemruz@gmail.com> Co-authored-by: Emruz Hossain <hossainemruz@gmail.com>
9 lines
338 B
JavaScript
9 lines
338 B
JavaScript
let theme = localStorage.getItem('theme-scheme') || localStorage.getItem('darkmode:color-scheme') || 'light'
|
|
if (theme === 'system') {
|
|
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
theme = 'dark'
|
|
} else {
|
|
theme = 'light'
|
|
}
|
|
}
|
|
document.documentElement.setAttribute('data-theme', theme)
|