Forced Colors Mode
Forced colors mode uses a user-chosen system palette instead of many page colors. This can make controls and text easier to distinguish.
@media (forced-colors: active) -> system colors + visible shape and statebackground + box-shadowButtonText · ButtonFace · borderoutline: 2px@media (forced-colors: active) -> system colors + visible shape and stateA11YAnother example
A button loses its author background and shadow. Its border, text, and focus indicator still show its shape and state.
Main parts
- 01Author palette
- 02User-forced palette
- 03Visible border
- 04System color
- 05Focus indicator
- 06Color-adjust exception
Use it when
Test controls with forced colors active. Keep important boundaries visible and use system colors for necessary adjustments.
Do not use it when
Do not depend on color or box shadow alone. Use forced-color-adjust none only when preserving color is essential.
Name used in code
@media (forced-colors: active) -> system colors + visible shape and state Before you ship
Before release, check the page structure, keyboard access, visible focus, contrast, and zoom. Also check loading, empty, error, success, cancel, and reduced-motion states.
Outcome: Use Forced Colors Mode to solve this user need without losing the current context. User context: A button loses its author background and shadow. Its border, text, and focus indicator still show its shape and state. Recommended pattern: Forced Colors Mode. Why it fits: Test controls with forced colors active. Keep important boundaries visible and use system colors for necessary adjustments. Do not use it when: Do not depend on color or box shadow alone. Use forced-color-adjust none only when preserving color is essential. Product requirements: Define the default, loading, empty, error, success, and recovery states. Keep user input. Give clear feedback after every action. Accessibility and resilience: Use semantic HTML, full keyboard access, and visible focus. Make the layout work when zoomed and support reduced motion. Follow the project’s current rules. Do not add a new UI library unless the project already uses it. Acceptance criteria: The main task works with keyboard only and at 320px width. Focus and status changes are announced. Check loading, failure, retry, cancel, and reduced-motion paths. Evidence and limits (evidence boundary): A formal document may still be a draft, release candidate, or final version. Check its status and browser or platform support. Unknowns to confirm: Product wording, data source, analytics events, supported devices and languages, and platform limits.
Check this request
Review the current use of Forced Colors Mode. Definition: Forced colors mode uses a user-chosen system palette instead of many page colors. This can make controls and text easier to distinguish. Release checks: Before release, check the page structure, keyboard access, visible focus, contrast, and zoom. Also check loading, empty, error, success, cancel, and reduced-motion states. Before changing code, report the evidence you found, gaps, severity, and the smallest safe fix.