Currently there is a user-facing toggle to change between light theme, dark theme, or 'system' (match whatever the OS theme is).
This manual toggle was originally added for user convenience. Having it be a manual setting requires quite a lot of behind-the-scenes work with JavaScript to remember the setting, set the HTML attributes, and try to avoid a flash-of-wrong-theme on each page load. This adds complexity and has a minor slowdown on loading speeds.
I'm not sure how many people actually use this toggle on anything but the default. (I don't collect any sort of analytics or events tracking, after all.)
The theme code would be a lot simpler if it always mirrored the system setting, in which case it could be implemented purely in CSS using the prefers-color-scheme media query.
Currently there is a user-facing toggle to change between light theme, dark theme, or 'system' (match whatever the OS theme is).
This manual toggle was originally added for user convenience. Having it be a manual setting requires quite a lot of behind-the-scenes work with JavaScript to remember the setting, set the HTML attributes, and try to avoid a flash-of-wrong-theme on each page load. This adds complexity and has a minor slowdown on loading speeds.
I'm not sure how many people actually use this toggle on anything but the default. (I don't collect any sort of analytics or events tracking, after all.)
The theme code would be a lot simpler if it always mirrored the system setting, in which case it could be implemented purely in CSS using the
prefers-color-scheme
media query.