Remove in-line script from header (#1004)

* 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>
This commit is contained in:
David G. Simmons 2024-12-01 09:37:33 -05:00 committed by GitHub
parent 3be5a58a7c
commit 4e4acdbb6b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 371 additions and 70 deletions

View file

@ -0,0 +1,9 @@
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)