Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
a57586a2
Commit
a57586a2
authored
Mar 17, 2024
by
Danny Liu
Browse files
use IIFE in app.html to prevent FOUC
parent
41cb6d7a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
26 deletions
+28
-26
src/app.html
src/app.html
+28
-26
No files found.
src/app.html
View file @
a57586a2
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
<meta
name=
"robots"
content=
"noindex,nofollow"
/>
<meta
name=
"robots"
content=
"noindex,nofollow"
/>
<script>
<script>
// On page load or when changing themes, best to add inline in `head` to avoid FOUC
// On page load or when changing themes, best to add inline in `head` to avoid FOUC
(()
=>
{
if
(
if
(
localStorage
.
theme
===
'
light
'
||
localStorage
.
theme
===
'
light
'
||
(
!
(
'
theme
'
in
localStorage
)
&&
window
.
matchMedia
(
'
(prefers-color-scheme: light)
'
).
matches
)
(
!
(
'
theme
'
in
localStorage
)
&&
window
.
matchMedia
(
'
(prefers-color-scheme: light)
'
).
matches
)
...
@@ -36,6 +37,7 @@
...
@@ -36,6 +37,7 @@
}
}
}
}
});
});
})();
</script>
</script>
%sveltekit.head%
%sveltekit.head%
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment