Description
There should be a button that switches the site between a light theme and a dark theme, with its default state set by something akin to window.matchMedia('(prefers-color-scheme: dark)')
Requirements
A white flash of light (a "flashbang") often occurs on pages that have toggleable themes before dark mode can be applied. There are ways to avoid this, described in the "Loading strategy" section of this reputable article.
Additional Notes
Let's be real, a site for coders should always have a dark theme.
Description
There should be a button that switches the site between a light theme and a dark theme, with its default state set by something akin to
window.matchMedia('(prefers-color-scheme: dark)')Requirements
A white flash of light (a "flashbang") often occurs on pages that have toggleable themes before dark mode can be applied. There are ways to avoid this, described in the "Loading strategy" section of this reputable article.
Additional Notes
Let's be real, a site for coders should always have a dark theme.