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
976c7140
Commit
976c7140
authored
Mar 27, 2024
by
Danny Liu
Browse files
feat: OLED dark theme
parent
7d45d276
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
src/lib/components/chat/Settings/General.svelte
src/lib/components/chat/Settings/General.svelte
+12
-3
tailwind.config.js
tailwind.config.js
+1
-2
No files found.
src/lib/components/chat/Settings/General.svelte
View file @
976c7140
...
...
@@ -97,6 +97,10 @@
themeToApply = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
}
if (themeToApply === 'dark') {
document.documentElement.style.setProperty('--color-gray-900', '#171717');
}
themes
.filter((e) => e !== themeToApply)
.forEach((e) => {
...
...
@@ -113,10 +117,14 @@
};
const themeChangeHandler = (_theme: string) => {
theme.set(_theme);
localStorage.setItem('theme', _theme);
if (_theme === 'oled') {
document.documentElement.style.setProperty('--color-gray-900', '#000000');
} else {
theme.set(_theme);
localStorage.setItem('theme', _theme);
applyTheme(_theme);
applyTheme(_theme);
}
};
</script>
...
...
@@ -139,6 +147,7 @@
<option value="light">☀️ {$i18n.t('Light')}</option>
<option value="rose-pine dark">🪻 {$i18n.t('Rosé Pine')}</option>
<option value="rose-pine-dawn light">🌷 {$i18n.t('Rosé Pine Dawn')}</option>
<option value="oled">🌌 {$i18n.t('OLED Dark')}</option>
</select>
</div>
</div>
...
...
tailwind.config.js
View file @
976c7140
...
...
@@ -16,8 +16,7 @@ export default {
700
:
'
#4e4e4e
'
,
800
:
'
#333
'
,
850
:
'
#262626
'
,
900
:
'
#171717
'
,
900
:
'
var(--color-gray-900, #171717)
'
,
950
:
'
#0d0d0d
'
}
},
...
...
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