-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[system] Warns if the hex color contains trailing space #44538
base: master
Are you sure you want to change the base?
Conversation
Netlify deploy previewhttps://deploy-preview-44538--material-ui.netlify.app/ Bundle size report |
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.
@siriwatknp what if we .trim()
the input instead?
it('warns if the color contains space at the end', () => { | ||
let result; | ||
expect(() => { | ||
result = hexToRgb('#aa0099 '); |
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.
I think it would be great to test a high-level API, like alpha()
instead. I don't see why hexToRgb() is public in the first place.
I don't think so. The point of this PR is to warn if the input is not correct. I am reluctant to process the input at this point. |
closes #44504
Test added.