|
@@ -14,7 +14,7 @@
|
|
|
export let getModels: Function;
|
|
|
|
|
|
// General
|
|
|
- let themes = ['dark', 'light', 'rose-pine dark', 'rose-pine-dawn light'];
|
|
|
+ let themes = ['dark', 'light', 'rose-pine dark', 'rose-pine-dawn light', 'oled-dark'];
|
|
|
let selectedTheme = 'system';
|
|
|
|
|
|
let languages = [];
|
|
@@ -91,12 +91,17 @@
|
|
|
});
|
|
|
|
|
|
const applyTheme = (_theme: string) => {
|
|
|
- let themeToApply = _theme;
|
|
|
+ let themeToApply = _theme === 'oled-dark' ? 'dark' : _theme;
|
|
|
|
|
|
if (_theme === 'system') {
|
|
|
themeToApply = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
|
}
|
|
|
|
|
|
+ if (themeToApply === 'dark' && !_theme.includes('oled')) {
|
|
|
+ document.documentElement.style.setProperty('--color-gray-900', '#171717');
|
|
|
+ document.documentElement.style.setProperty('--color-gray-950', '#0d0d0d');
|
|
|
+ }
|
|
|
+
|
|
|
themes
|
|
|
.filter((e) => e !== themeToApply)
|
|
|
.forEach((e) => {
|
|
@@ -115,7 +120,11 @@
|
|
|
const themeChangeHandler = (_theme: string) => {
|
|
|
theme.set(_theme);
|
|
|
localStorage.setItem('theme', _theme);
|
|
|
-
|
|
|
+ if (_theme.includes('oled')) {
|
|
|
+ document.documentElement.style.setProperty('--color-gray-900', '#000000');
|
|
|
+ document.documentElement.style.setProperty('--color-gray-950', '#000000');
|
|
|
+ document.documentElement.classList.add('dark');
|
|
|
+ }
|
|
|
applyTheme(_theme);
|
|
|
};
|
|
|
</script>
|
|
@@ -136,6 +145,7 @@
|
|
|
>
|
|
|
<option value="system">⚙️ {$i18n.t('System')}</option>
|
|
|
<option value="dark">🌑 {$i18n.t('Dark')}</option>
|
|
|
+ <option value="oled-dark">🌃 {$i18n.t('OLED Dark')}</option>
|
|
|
<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>
|