-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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(styles): add error handling for rem & em sass functions #4931
fix(styles): add error handling for rem & em sass functions #4931
Conversation
Deploy preview for carbon-elements ready! Built with commit e8cba9f |
Deploy preview for carbon-elements ready! Built with commit 859a3ed |
What would you think of the following warning format:
|
Deploy preview for carbon-components-react ready! Built with commit 859a3ed https://deploy-preview-4931--carbon-components-react.netlify.com |
@jendowns also, would adding |
Deploy preview for the-carbon-components ready! Built with commit 859a3ed https://deploy-preview-4931--the-carbon-components.netlify.com |
Thanks @joshblack! Just made the changes you suggested. Personally I prefer |
Thanks @joshblack - I like that idea! I just pushed a commit with those comments added. I'll also add a comment to the issue you linked to, for v11 changes (unless you wanted to do that?) |
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.
LGTM 👍 - Thanks @jendowns!
Related to #4926 & #4927
I think it would be a good idea to add a little bit of error handling to the
carbon--rem
/carbon--em
functions (and their deprecated versions too).Since these functions all require pixel values to output valid CSS, it would be nice to notify developers directly from these functions when a non-pixel value is received. (Without pixel values, the functions return invalid output -- see this CodePen for examples: https://codepen.io/jendowns/pen/PowpyQJ)
@warn
rule: https://sass-lang.com/documentation/at-rules/warnChangelog
New
@error
@warn
check tocarbon--rem
/rem
andcarbon--em
/em
functions