Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USWDS - Checkbox and radio: Update tile color definitions #5494

Merged
merged 3 commits into from
Sep 29, 2023

Conversation

amyleadem
Copy link
Contributor

@amyleadem amyleadem commented Sep 8, 2023

Summary

Updated radio and checkbox tile styling to have lighter borders.

This change reverts border color styles to be more similar to what they were in 3.4.0 and could help with comprehension for users with visual processing disorders.

Note
This is the first part of the effort to make checkbox and radio tile styles more accessible to users with visual processing disorders. We will need to dive deeper into what we can do to reduce visual noise so that the content is easier to focus on. Issue #5487 tracks the larger effort for this.

Breaking change

This is not a breaking change.

Related issue

Closes #5490

Related pull requests

Changelog PR

Preview link

Problem statement

In release 3.5.0, we updated disabled styles for our form elements, which inadvertently darkened the color of the borders on the checkbox and radio tile boxes. This color changed increased the visual noise, which can have a negative impact on users with visual processing disorder.

Reference: Color definition change in 3.5.0

Solution

The tile borders are not actually representing disabled states, so we can make the component more resilient by defining the border colors with system tokens instead.

The disabled states will continue to use disabled color tokens ("disabled"/"gray-50") and will now meet color contrast requirements.

image

Testing and review

  • Confirm that tile border styles more closely align with those found in release-3.4.0
    • Note: Disabled states will look darker than in 3.4.0. This is expected. Disabled styles should meet contrast standards and also align with other current disabled form inputs.
  • Confirm that the switch from disabled state colors to system colors make sense.
  • Confirm no unexpected visual regressions

Copy link
Contributor

@mejiaj mejiaj left a comment

Choose a reason for hiding this comment

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

Those screenshots were very helpful! Thanks for updating. I tested:

  • Default checkbox & radio.
  • Checkbox & radio with tests uncommented.

@@ -32,8 +32,8 @@
1
);
$input-border-alpha: -0;
$color-input-disabled: color("disabled");
$color-input-disabled--weak: color("disabled-lighter");
$tile-border-color: color("gray-20");
Copy link
Contributor

Choose a reason for hiding this comment

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

Any thoughts on making the border a bit darker at gray-30?

Adds an extra step between the actual disabled element element and the default which might help to distinguish the difference between the two for lower visioned users

Disabled comparison

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I lean towards keeping the border color "gray-20". My reasoning is that I don't think that the border color should do much work to indicate that the element is disabled. Instead, it should be the lightened text and radio button color that carries that lift.

In my mind, this PR primarily exists to restore the styles from 3.4.0, which are more closely aligned with "gray-20". Secondarily, the aim is to reduce visual noise to make this easier to read for users with visual processing disorders. Lightening the borders is likely not enough for that effort, but it is a step in the right direction.

Curious what you and others think!

Copy link
Contributor

Choose a reason for hiding this comment

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

That's totally fair! Definitely want to make sure it's readable for all. If that means relying more so on the text and radio/checkbox input color, so be it!

@amyleadem
Copy link
Contributor Author

Putting this PR in draft because it is not clear if this will help or harm users with visual processing disorders. Additionally, according to this comment from @mahoneycm, the style change was intentional to meet contrast standards.

The a11y team is actively engaging with this topic and I recommend we hold off on integrating this change until we can have more discussions about best practice here.

@amyleadem amyleadem marked this pull request as ready for review September 29, 2023 15:32
@amyleadem
Copy link
Contributor Author

Opening this PR again after further discussion with the team. We are treating this as a visual regression fix that reduces visual noise. We will follow up with more investigation into how current tile styling affects users with visual processing disorders in issue #5487.

Copy link
Member

@thisisdano thisisdano left a comment

Choose a reason for hiding this comment

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

Thanks for all the thought on d discussion on this one. This change is a good step forward, and we'll keep taking more!

@thisisdano thisisdano merged commit bb4c8e7 into develop Sep 29, 2023
3 checks passed
@thisisdano thisisdano deleted the al-radio-tile-color branch September 29, 2023 17:04
@thisisdano thisisdano mentioned this pull request Sep 29, 2023
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.

USWDS - Radio and checkbox: Revert tile border colors
4 participants