"...git@developer.sourcefind.cn:chenpangpang/open-webui.git" did not exist on "f04164378aab5e8dbe7330fdd6748ea216de996a"
Commit 976c7140 authored by Danny Liu's avatar Danny Liu
Browse files

feat: OLED dark theme

parent 7d45d276
...@@ -97,6 +97,10 @@ ...@@ -97,6 +97,10 @@
themeToApply = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'; themeToApply = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
} }
if (themeToApply === 'dark') {
document.documentElement.style.setProperty('--color-gray-900', '#171717');
}
themes themes
.filter((e) => e !== themeToApply) .filter((e) => e !== themeToApply)
.forEach((e) => { .forEach((e) => {
...@@ -113,10 +117,14 @@ ...@@ -113,10 +117,14 @@
}; };
const themeChangeHandler = (_theme: string) => { const themeChangeHandler = (_theme: string) => {
theme.set(_theme); if (_theme === 'oled') {
localStorage.setItem('theme', _theme); document.documentElement.style.setProperty('--color-gray-900', '#000000');
} else {
theme.set(_theme);
localStorage.setItem('theme', _theme);
applyTheme(_theme); applyTheme(_theme);
}
}; };
</script> </script>
...@@ -139,6 +147,7 @@ ...@@ -139,6 +147,7 @@
<option value="light">☀️ {$i18n.t('Light')}</option> <option value="light">☀️ {$i18n.t('Light')}</option>
<option value="rose-pine dark">🪻 {$i18n.t('Rosé Pine')}</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="rose-pine-dawn light">🌷 {$i18n.t('Rosé Pine Dawn')}</option>
<option value="oled">🌌 {$i18n.t('OLED Dark')}</option>
</select> </select>
</div> </div>
</div> </div>
......
...@@ -16,8 +16,7 @@ export default { ...@@ -16,8 +16,7 @@ export default {
700: '#4e4e4e', 700: '#4e4e4e',
800: '#333', 800: '#333',
850: '#262626', 850: '#262626',
900: 'var(--color-gray-900, #171717)',
900: '#171717',
950: '#0d0d0d' 950: '#0d0d0d'
} }
}, },
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment