-
Notifications
You must be signed in to change notification settings - Fork 779
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(color-contrast): allow small text shadows to serve as text outline #2627
Conversation
2e6f9fd
to
1a6d783
Compare
return 3.7 / (blurRadius + 8); | ||
const relativeBlur = blurRadius / fontSize; | ||
return 0.185 / (relativeBlur + 0.4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In working through this I realised these numbers should be relative to the font-size. I used a 20px font when I got these numbers, so I divided the numbers by 20. Block 9 in the text-shadow integration tests handle this.
/* | ||
False positives: | ||
- b5-r3-i1, b5-r3-i2 | ||
- b7-r3-i1, b7-r3-i2 | ||
|
||
False negatives: | ||
- b3-r1-i1 | ||
- b4-r1-i1, b4-r2-i1 | ||
- b8-r1-i1, b8-r5-i1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left this here just to have a record of it. All these test cases are on the edge of pass and fail. If we ever revisit them, these are the ones I think could be improved on, but I suspect I've put enough time into this it'll never come up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you put this comment in the code? Otherwise in a month or two we won't remember what the comment in the code means (there's no context).
Co-authored-by: Steven Lambert <2433219+straker@users.noreply.github.com>
Closes issue: #2541
Reviewer checks
Required fields, to be filled out by PR reviewer(s)