mirror of
https://github.com/nimbold/Firelink.git
synced 2026-08-19 07:36:17 +00:00
fix(settings): honor look and feel controls
This commit is contained in:
+14
-10
@@ -512,17 +512,21 @@ function App() {
|
||||
// Remove all theme classes first
|
||||
root.classList.remove('theme-dark', 'theme-light', 'theme-dracula', 'theme-nord', 'dark');
|
||||
|
||||
if (theme === 'system') {
|
||||
const systemDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
root.classList.add(systemDark ? 'theme-dark' : 'theme-light');
|
||||
if (systemDark) root.classList.add('dark');
|
||||
} else {
|
||||
root.classList.add(`theme-${theme}`);
|
||||
if (['dark', 'dracula', 'nord'].includes(theme)) {
|
||||
root.classList.add('dark');
|
||||
}
|
||||
if (theme === 'system') {
|
||||
const systemDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
root.classList.add(systemDark ? 'theme-dark' : 'theme-light');
|
||||
root.dataset.resolvedTheme = systemDark ? 'dark' : 'light';
|
||||
root.style.colorScheme = systemDark ? 'dark' : 'light';
|
||||
if (systemDark) root.classList.add('dark');
|
||||
} else {
|
||||
root.classList.add(`theme-${theme}`);
|
||||
if (['dark', 'dracula', 'nord'].includes(theme)) {
|
||||
root.classList.add('dark');
|
||||
}
|
||||
};
|
||||
root.dataset.resolvedTheme = ['dark', 'dracula', 'nord'].includes(theme) ? 'dark' : 'light';
|
||||
root.style.colorScheme = ['dark', 'dracula', 'nord'].includes(theme) ? 'dark' : 'light';
|
||||
}
|
||||
};
|
||||
|
||||
applyTheme();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user