Skip to content

fix: make text colors legible #3250

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

Merged
merged 6 commits into from
Jul 27, 2022
Merged

fix: make text colors legible #3250

merged 6 commits into from
Jul 27, 2022

Conversation

presleyp
Copy link
Contributor

@presleyp presleyp commented Jul 27, 2022

Fixes #3222
Fixes #3230

  • changed error.main color to a lighter one for legible color contrast in validation error messages
  • added contrastText to more parts of the palette so we use it instead of defaulting to illegible near-black
  • changed Dialog styles to use error.dark as the button background instead of error.main. Hover styles darken a color, and error.dark is VERY dark currently, so I had it start at a lightened version and darken to the standard.

The color palette will need more work - the color contrast between button background and text doesn't pass accessibility tests on other buttons (the blue ones). But this PR improves the most egregious places I had seen.

Screen Shot 2022-07-27 at 11 01 59 AM

Screen Shot 2022-07-27 at 11 01 37 AM

Testing

Validation messages

Given I am logged out,
When I type a letter in the email field and then click on the password field,
Then I see a legible validation message

Dialogs

Given I have created a new user,
When I suspend that user,
Then I see a confirmation dialog with legible buttons

@presleyp presleyp changed the title Brighten error/presleyp/3222 fix: make text colors legible Jul 27, 2022
@presleyp presleyp marked this pull request as ready for review July 27, 2022 15:03
@presleyp presleyp requested a review from a team as a code owner July 27, 2022 15:03
@AbhineetJain
Copy link
Contributor

Did we also test the contrast for the background of the ErrorSummary component and the details section inside it? I remember using error.main with darken for it, so wondering if that would change as well.

@AbhineetJain
Copy link
Contributor

As per Storybook, there seem to be multiple components that have updated. I am not sure if some of the color combinations are aesthetically okay e.g. this one with the error box and the field error having different reds.

@presleyp
Copy link
Contributor Author

@AbhineetJain yeah, background and text colors should differ, that's ok. The contrast between the ErrorSummary background and its text is good but between the background and the More/Less link is not good, so I'll need to tweak that or note it for later. I'll keep going through Chromatic...

@presleyp
Copy link
Contributor Author

Ok, I lightened the color in our palette that's used for links, so we'll see what changes that causes! It does fix the contrast in the Error Summary.

@presleyp
Copy link
Contributor Author

Lightening all links made them too un-obvious, I think, so I just lightened the link in ErrorSummary.

@presleyp presleyp merged commit a37e61a into main Jul 27, 2022
@presleyp presleyp deleted the brighten-error/presleyp/3222 branch July 27, 2022 17:49
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.

Fix color in Dialog Fix color on invalid fields
3 participants