Skip to content

USWDS: Radio Button & Checkbox - Windows High Contrast Support#4509

Merged
mejiaj merged 6 commits into
cm-high-contrast-a11yfrom
cm-radio-high-contrast
Feb 22, 2022
Merged

USWDS: Radio Button & Checkbox - Windows High Contrast Support#4509
mejiaj merged 6 commits into
cm-high-contrast-a11yfrom
cm-radio-high-contrast

Conversation

@mahoneycm

@mahoneycm mahoneycm commented Feb 9, 2022

Copy link
Copy Markdown
Contributor

Previews

Radio Button →

Checkbox →

Description

Resolves #4469 checkbox & radio button issues

Currently, the radio button and checkbox components are missing important visual queues for users implementing Windows High Contrast mode including the buttons/boxes themselves, when a selection has been made, and a visual queue of disabled form options.

This PR adds forced-colors: active settings to ensure visibility for all users.

Because most of the stylings are shared between Radio + Checkbox, it was easiest to fix together.

Additional information

Radio Buttons

Currently:

Default

image

Tile

image

After Fix:

// Note: Bolder border around Radio button / checkbox indicates focus

Default:

image

Tile:

image

Checkbox

Currently

Default:

image

Tile:

image

After Fix

Default:

image

Tile:

image

The checkmark will not show in both cases due to the limitations of forced-colors mode being able to determine light or dark themes, to switch between the light and dark versions of the checkmark.

Our thinking was that the dark high contrast themes are more frequently used than the light themes, so the broader user base will get the most similar checkboxes, stylistically speaking, while the light users still maintain a functional componen

Before you hit Submit, make sure you’ve done whichever of these applies to you:

  • Follow the 18F Front End Coding Style Guide and Accessibility Guide.
  • Run npm test and make sure the tests for the files you have changed have passed.
  • Run your code through HTML_CodeSniffer and make sure it’s error free.
  • Title your pull request using this format: [Website] - [UI component]: Brief statement describing what this pull request solves.

Charlie Mahoney added 2 commits February 9, 2022 14:05
@mahoneycm mahoneycm requested a review from mejiaj February 9, 2022 19:59
@mahoneycm mahoneycm changed the base branch from develop to cm-high-contrast-a11y February 10, 2022 15:05
@mahoneycm

mahoneycm commented Feb 11, 2022

Copy link
Copy Markdown
Contributor Author

Fixed a bug where the "checked" status for checkboxes was not appearing in white background high contrast themes.

Instead, the checkmark will show in black background themes and the white background themes will show a blacked out checkbox

Before:

image

After:

image

The checkmark will not show in both cases due to the limitations of forced-colors mode being able to determine light or dark themes, to switch between the light and dark versions of the checkmark.

Our thinking was that the dark high contrast themes are more frequently used than the light themes, so the broader user base will get the most similar checkboxes, stylistically speaking, while the light users still maintain a functional component

Note: I did try to remedy this using add-color-icon() but the mask would replace the entire checkbox and border

image

@mahoneycm

Copy link
Copy Markdown
Contributor Author

This update also adjusts tile selection styling, addressing a low contrast concern

image

This was referenced Feb 14, 2022

@mejiaj mejiaj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great in Win11 HCM themes.

Added my comments. Also, I would add an empty line before these forced-color media queries.

Comment thread src/stylesheets/elements/form-controls/_checkbox-and-radio.scss Outdated
Comment thread src/stylesheets/elements/form-controls/_checkbox-and-radio.scss Outdated
@mahoneycm mahoneycm requested a review from mejiaj February 15, 2022 18:52
@mejiaj

mejiaj commented Feb 22, 2022

Copy link
Copy Markdown
Contributor

Nice work!

@mejiaj mejiaj merged commit fe9a388 into cm-high-contrast-a11y Feb 22, 2022
@mejiaj mejiaj deleted the cm-radio-high-contrast branch February 22, 2022 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Audit components in Windows HC mode

2 participants