Set dark mode based on system settings
This example shows how to change the map mode (light/dark) of the map based on the system settings.
The dark mode become more and more popular. To determine whether the system settings are normal or dark, we employ the matchMedia function that allows checking programmatically whether a CSS media query (prefers-color-scheme) has been fulfilled or not.
Related examples
An extension of MapLibre GL JS