How to keep a button icon visible in forced-colors mode
Answer in brief
Test controls in a forced-colors environment, especially when their icons rely on background paint or box shadows. Use a shape or text treatment that remains distinguishable under the user's palette.
Inspect a custom check button
Enable forced colors and compare checked, unchecked and focused states. If a shadow-only boundary disappears, add a visible border for that mode. Verify the check itself survives on the system button background.
Compare selection and keyboard focus
Select an item with the mouse, then tab to an adjacent item with forced colors enabled. If the two items look identical, their indicators may both depend on the same replaced colors. Try distinct shapes such as a check for selection and an outline for focus, then repeat the two-state test.
Sources
- [1] forced-colors CSS media feature - CSS — MDN Web Docs, accessed November 23, 2026
Frequently asked questions
Should I disable forced-color adjustments for the whole toolbar?
Start by adapting individual controls to the user's palette. Broad overrides can remove the contrast the user chose.