The tab label nobody could see
We once shipped a tab you couldn’t read. The label rendered, technically, in a color that matched its background in one particular theme. A screenshot review caught it: a tab strip with a blank space where a filename belonged.
Fixing that instance took minutes. The useful work was deciding what to do about the category, because invisible text is a category. It appears wherever a foreground from one palette lands on a background from another, and dark themes are its natural habitat. A control template nobody re-themed keeps its light system background, inherits the dark theme’s light text, and the text disappears. We met the same category again months later in our own File menu: the popup deliberately stays light, the menu items inherited a dark theme’s pale foreground, and the whole menu washed out. A person found that one too, during a manual sweep the day we thought we were done.
Two humans catching two instances of the same disease was enough. Legibility became arithmetic. The unit suite now walks every theme we ship, including High Contrast, and computes the WCAG contrast ratio for every text-and-background pair that matters: editor text, console streams, status bar, panel chrome, menu popup ink, and all eleven syntax token colors against the editor background. Anything under the AA threshold of 4.5 to 1 fails the build.
Tab labels get special attention because of the original bug. Both states are tested, active and inactive, since the pair you don’t test is the pair that ships broken. A second assertion requires the active tab’s background to differ from the strip’s, because a tab can be perfectly legible and still indistinguishable from its neighbors, which is a different way of being invisible.
The menu fix added its own guard. Popup text is pinned dark, since the popup is always light, while the top-level menu bar follows the theme. A test pins the pinning, so a future refactor that re-binds popup text to a theme brush fails the moment any dark theme would ship it unreadable.
Human theme sweeps still happen before releases. The math doesn’t judge whether a pairing is ugly, and ugly is worth catching too. But whether text can be read is no longer an opinion held by whoever looked last. It’s a number with a floor, and the floor has a test.