-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
rgbaRegex fails 3 digit decimals #610
Comments
@levymetal We would definitely accept a PR for this. Generally, we try to clean up long floats as it causes weird behaviors and inconsistent calculations in some browsers. However, I still consider this a regression and would want to accept broader inputs even though we clean it up on behalf of the user. |
@bhough this is definitely a pretty nasty bug: Since version: 4.2.1: // Throws no error
console.log(shade(0.05, 'rgba(247,213,175,0.56)'));
// Throws error since 4.2.1
console.log(mix(0.7, shade(0.05, 'rgba(247,213,175,0.56)'), '#3768fa')); Codesandbox: |
Addresses an issue introduced in 4.2.1 that broke colors with values of various float lengths. fix #610
This should be fully addressed in 4.2.2 Thank @levymetal! |
Summary
polished
version: 4.2.1After #609,
rgbaRegex
no longer allows more than two decimal places for the alpha component. While this is an edge case, it's not totally unreasonable - in theory the minimum step should be 1/256. Also, because it now accepts a percentage, the maximum precision differs depending on the unit. Eg, we can pass2.8%
but not0.028
.I'm happy to whip up a PR if this is considered a regression - just let me know.
Mixin/Helper/Shorthand Usage
What You Are Seeing
Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.
What You Expected To See
#000
Reproduction
n/a
The text was updated successfully, but these errors were encountered: