standarize configuration
This commit is contained in:
parent
e4522e429a
commit
37351acf91
17 changed files with 150 additions and 108 deletions
|
@ -30,11 +30,16 @@
|
|||
</head>
|
||||
<script>
|
||||
// default to system color scheme.
|
||||
let systemColorScheme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
||||
let default_theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
||||
|
||||
try {
|
||||
document.querySelector('html').classList.add(systemColorScheme);
|
||||
localStorage.setItem('theme', systemColorScheme);
|
||||
const local = localStorage.getItem('theme')
|
||||
if (local) {
|
||||
default_theme = local
|
||||
}
|
||||
localStorage.setItem('theme', default_theme);
|
||||
window.minima_theme = default_theme;
|
||||
document.querySelector('html').classList.add(default_theme);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue