Fix FOUC.
This commit is contained in:
parent
3ca011568d
commit
f3c42f9014
1 changed files with 15 additions and 0 deletions
|
|
@ -13,6 +13,21 @@ const base = import.meta.env.BASE_URL;
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<script is:inline>
|
||||
var cl = document.documentElement.classList;
|
||||
if ('theme' in localStorage || 'af_mode' in localStorage) {
|
||||
if (localStorage.af_enabled === '1' && localStorage.af_mode === 'df') {
|
||||
cl.add('df');
|
||||
} else {
|
||||
if (localStorage.theme === 'dark' || window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
||||
cl.add('dark');
|
||||
}
|
||||
if (localStorage.af_enabled === '1' && localStorage.af_mode == 'hc') {
|
||||
cl.add('hc');
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="theme-color" content="#28303c" />
|
||||
|
|
|
|||
Loading…
Reference in a new issue