-
Notifications
You must be signed in to change notification settings - Fork 66
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: avoid infinite while loop with colorYiq
#2349
fix: avoid infinite while loop with colorYiq
#2349
Conversation
6a8b5a6
to
d9144cb
Compare
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## alpha #2349 +/- ##
=======================================
Coverage 91.58% 91.58%
=======================================
Files 214 214
Lines 3519 3519
Branches 852 852
=======================================
Hits 3223 3223
Misses 288 288
Partials 8 8 ☔ View full report in Codecov by Sentry. |
🎉 This PR is included in version 21.0.0-alpha.32 🎉 The release is available on: Your semantic-release bot 📦🚀 |
* fix: avoid never ending while loop with colorYiq * fix: replace scss variable with css variable
* fix: avoid never ending while loop with colorYiq * fix: replace scss variable with css variable
🎉 This PR is included in version 22.0.0-alpha.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 23.0.0-alpha.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
Running the updated
colorYiq
function that tries to automatically darken/brighten color tokens if they do not pass background/foreground color contrast ratio of 4.5:1 for a11y hits an infinite loop if the colors can never meet a 4.5:1 contrast ratio.This PR ensures we only try to brighten/darken tokens a max of 10 times to avoid an infinite loop. Consoles a warning with the design token name when it couldn't brighten/darken tokens sufficiently to pass a 4.5:1 contrast ratio.
Deploy Preview
N/A
Merge Checklist
example
app?wittjeff
andadamstankiewicz
as reviewers on this PR.Post-merge Checklist