Fix map display and auto theme detection
- Add missing #map CSS styles to fix map container display - Fix auto theme detection by implementing proper system preference detection - Update applyTheme function in all JS files to handle 'auto' theme correctly - System theme changes are now properly detected and applied when in auto mode
This commit is contained in:
parent
e1be90011e
commit
c5356b611a
3 changed files with 21 additions and 3 deletions
|
@ -165,7 +165,13 @@
|
|||
}
|
||||
|
||||
function applyTheme(theme) {
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
if (theme === 'auto') {
|
||||
// Detect system preference and apply appropriate theme
|
||||
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
document.documentElement.setAttribute('data-theme', prefersDark ? 'dark' : 'light');
|
||||
} else {
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
}
|
||||
}
|
||||
|
||||
function updateThemeIcon(theme, iconElement) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue