diff --git a/proxy/js/styles.mjs b/proxy/js/styles.mjs index 4e732f7c..d911c013 100644 --- a/proxy/js/styles.mjs +++ b/proxy/js/styles.mjs @@ -4922,7 +4922,11 @@ function makeLegendStyle(style) { }, minzoom: legendZoom, maxzoom: legendZoom + 1, - paint: {}, + paint: { + 'text-color': 'black', + 'text-halo-color': 'white', + 'text-halo-width': 1, + }, layout: { 'text-field': '{legend}', 'text-font': ['Noto Sans Medium'], diff --git a/proxy/js/ui.js b/proxy/js/ui.js index 198d7ae6..55757597 100644 --- a/proxy/js/ui.js +++ b/proxy/js/ui.js @@ -397,13 +397,14 @@ function updateBackgroundMapStyle() { backgroundMap.setStyle(buildBackgroundMapStyle()); } -function updateTheme() { - const configuredTheme = configuration.theme ?? defaultConfiguration.theme - const resolvedTheme = configuredTheme === 'system' +function resolveTheme(configuredTheme) { + return configuredTheme === 'system' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : configuredTheme; +} - document.documentElement.setAttribute('data-bs-theme', resolvedTheme) +function updateTheme() { + document.documentElement.setAttribute('data-bs-theme', resolveTheme(configuration.theme ?? defaultConfiguration.theme)); } function updateBackgroundMapContainer() {