Expand cache

This commit is contained in:
James Cole
2023-08-27 07:45:09 +02:00
parent 66cc3f48bc
commit 83d94cb792
12 changed files with 261 additions and 61 deletions

View File

@@ -32,13 +32,16 @@
const setTheme = theme => {
if (theme === 'browser' && window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.documentElement.setAttribute('data-bs-theme', 'dark')
window.theme = 'dark';
return;
}
if (theme === 'browser' && window.matchMedia('(prefers-color-scheme: light)').matches) {
window.theme = 'light';
document.documentElement.setAttribute('data-bs-theme', 'light')
return;
}
document.documentElement.setAttribute('data-bs-theme', theme)
window.theme = theme;
}
setTheme(getPreferredTheme())