The naive version of dark mode is one line: swap the background and the text. Everything renders, nothing crashes, and a dozen small things are now subtly wrong.
Contrast is not symmetric
A brand colour chosen against white will usually fail against near-black. A saturated blue that reads confidently on paper can drop to a contrast ratio that is uncomfortable at body size and genuinely unreadable at caption size.
So a palette that supports both themes needs two blues, not one: the fill colour, where the text sitting on it is white either way, and the text colour, which lifts in dark mode to stay legible. Once that distinction exists, the rule is easy to hold — this colour fills, that colour writes.
Shadows go the other way. Elevation on paper is a shadow; on a dark surface a shadow is invisible, and the same job has to be done with a lighter surface or a border. Designs that rely on shadow for hierarchy lose their hierarchy entirely when the lights go out.
Some things must not flip
Not every surface should invert. A band that is deliberately dark in the light theme — a page header, a closing strip — usually needs to stay dark in the dark theme, because it is doing a compositional job rather than a tonal one. Which means the tokens have to distinguish “dark for now” from “dark always”, and anything written on the second kind must be styled for dark permanently.
Brand marks are the other exception. A logo is a fixed thing, and the contrast rules that apply to type do not apply to it in the same way.
Choose it before the first screen
Retrofitting is the expensive path, because every hard-coded colour has to be found and every image with a baked-in white background has to be redone.
Deciding up front costs almost nothing: colours are named by role rather than by value, the theme swaps the values, and the switch is remembered and applied before the first paint so nobody sees a white flash on the way to the dark page they asked for.