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

fix: recalibrate getTextColor function #983

Merged
merged 1 commit into from
Jul 27, 2023

Conversation

nataliepina
Copy link
Collaborator

@nataliepina nataliepina commented Jul 26, 2023

Ensure that getTextColor is choosing colors with better contrast.

Description

QA noticed that using this color #005E70 for a background color opted for a dark text color. This does not pass WCAG 2.0 AA compliance of a 4.5:1 contrast ratio for normal text. Therefore the text was hard to read on the background color.
I've adjusted and tested this function so that it will perform better and choose the text color with a higher color contrast.

Which issue(s) does this PR relate to?

Testing

The best way to test this would be to bring it in downstream. So either copy/paste the function over in the code or try to use npm link.

Trade-offs

This function is pretty complex 😅

Screenshots

Checklist

  • This PR is associated with a JIRA and it is mentioned in the commit message footer ("Closes …")
  • Significant changes have been tested downstream to avoid breaking changes
  • This PR contains breaking changes and states in the commit message body ("BREAKING CHANGE: …")
  • I have reviewed the changes and provided detail to the sections above

@nataliepina nataliepina marked this pull request as ready for review July 26, 2023 13:26
@nataliepina nataliepina requested a review from a team as a code owner July 26, 2023 13:26
@github-actions
Copy link

github-actions bot commented Jul 26, 2023

Uffizzi Ephemeral Environment deployment-31842

☁️ https://app.uffizzi.com/github.com/d2iq/ui-kit/pull/983

📄 View Application Logs etc.

What is Uffizzi? Learn more!

Ensure that getTextColor is choosing colors with better contrast.
@mstruebing mstruebing force-pushed the npina/fix/get-text-color-stronger-contrast branch from 7d31e4b to c3b0ee6 Compare July 27, 2023 09:56
@mstruebing mstruebing enabled auto-merge (squash) July 27, 2023 09:56
@mstruebing mstruebing merged commit 402461e into main Jul 27, 2023
5 checks passed
@mstruebing mstruebing deleted the npina/fix/get-text-color-stronger-contrast branch July 27, 2023 09:59
@github-actions
Copy link

🎉 This PR is included in version 15.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants