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 - Forms: Remove high-contrast disabled border from %block-input-styles #5397

Merged
merged 2 commits into from
Aug 11, 2023

Conversation

mahoneycm
Copy link
Contributor

@mahoneycm mahoneycm commented Jul 20, 2023

Summary

Fixed a bug that caused standard text input variants to show disabled styles in forced colors mode. Now the disabled border color only shows when the element is disabled.

Breaking change

This is not a breaking change.

Related issue

Closes #5396

Related pull requests

Changelog →

Preview link

Preview link:

Problem statement

Text input form elements in high contrast mode display the disabled border by default.

Solution

Removed the disabled high contrast border mixin from the %block-input-styles placeholder. This prevents the disabled border by default for text input elements.

Testing and review

  1. Visit any text input form element
  2. Turn on forced-colors mode via the render tab within devTools (or whatever your preferred method is)
  3. Confirm the input border matches text color
  4. Activate the elements disabled state
  5. Confirm that the element's border color changes to the disabled color.

Testing checklist

  • Confirm text input elements do not have disabled border by default
  • Confirm that disabled border is correctly applied to disabled input elements

@mahoneycm mahoneycm marked this pull request as ready for review July 20, 2023 15:54
Copy link
Contributor

@amyleadem amyleadem 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 this quick fix, @mahoneycm.

Note
The input mask component currently shows disabled styles but this (and other issues with input mask in forced colors mode) will be addressed in PR #5378

  • Confirmed that disabled form input components do show disabled colors
  • Confirmed that the u-disabled-high-contrast-border mixin is only used in Sass for disabled states

Tested with Chrome forced-colors emulation

Before (Non-disabled state):

image

After (Non-disabled state):

image

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.

I was able to confirm these styles are only showing for disabled inputs in HCM. Below is a screenshot of the visual difference of an active (not disabled) input vs disabled.

Active (top) vs Disabled (bottom)
image


Warning
While testing I discovered a duplicate media query related to this work. Created issue USWDS - Bug: Duplicate forced colors media query · Issue #5403 · uswds/uswds for that.

@mejiaj mejiaj requested a review from thisisdano July 28, 2023 18:39
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.

Nice scoped fix

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 - Bug: All text input forms default to disabled border color in high contrast mode
4 participants