Fix radio button checked state visibility in forced-colors mode#3929
Draft
rickreyhsig wants to merge 1 commit intomainfrom
Draft
Fix radio button checked state visibility in forced-colors mode#3929rickreyhsig wants to merge 1 commit intomainfrom
rickreyhsig wants to merge 1 commit intomainfrom
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Authors: Please fill out this form carefully and completely.
Reviewers: By approving this Pull Request you are approving the code change, as well as its deployment and mitigation plans.
Please read this description carefully. If you feel there is anything unclear or missing, please ask for updates.
What are you trying to accomplish?
Fix radio button checked state visibility under Windows High Contrast themes (forced-colors mode). Currently, .FormControl-radio has a @media (forced-colors: active) block that styles only the base (unchecked) state with canvastext. Since the radio uses appearance: none and relies on border-width changes for the checked indicator, both states appear identical under forced-colors because the browser overrides custom colors.
This adds a @media (forced-colors: active) rule inside &:checked using the SelectedItem system color, mirroring the existing pattern used by .FormControl-checkbox:checked.
Screenshots
Integration
List the issues that this change affects.
Closes https://github.com/github/accessibility-audits/issues/9855
Risk Assessment
What approach did you choose and why?
Used the SelectedItem system color for the checked state to differentiate it from the unchecked canvastext state. This follows the same pattern already used by .FormControl-checkbox:checked at line 739, which also adds a forced-colors block inside its :checked rule.
Anything you want to highlight for special attention from reviewers?
The unchecked forced-colors block (line 808) uses canvastext. The new checked block uses SelectedItem so the two states are visually distinct. These are CSS system colors defined by the CSS Color Module Level 4 spec.
Accessibility
Merge checklist
Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.