#darkmode Clear
Tags #utils #browser #performance #array #async #dom #objects #pattern #events #format #concurrency #http #ui #advanced #fetch #url #string #functional #cache #files #crypto #promise #intl #observer
JavaScript Detect Dark Mode Preference
Reads the user's OS-level dark mode preference using the prefers-color-scheme media query and watches for live changes. Useful for initialising theme state before any user interaction and reacting automatically when the user switches their system theme without reloading the page.