mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-14 05:15:18 +00:00
Merge pull request #4975 from sebdanielsson/automatic-theme-update
fix: Update color theme on system change
This commit is contained in:
commit
f75908ebe3
1 changed files with 4 additions and 0 deletions
|
|
@ -22,6 +22,10 @@
|
||||||
<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 (!localStorage?.theme) {
|
||||||
|
localStorage.theme = 'system';
|
||||||
|
}
|
||||||
|
|
||||||
if (localStorage?.theme && localStorage?.theme.includes('oled')) {
|
if (localStorage?.theme && localStorage?.theme.includes('oled')) {
|
||||||
document.documentElement.style.setProperty('--color-gray-800', '#101010');
|
document.documentElement.style.setProperty('--color-gray-800', '#101010');
|
||||||
document.documentElement.style.setProperty('--color-gray-850', '#050505');
|
document.documentElement.style.setProperty('--color-gray-850', '#050505');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue