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
Ignore non-standard syntax in function-calc-no-invalid #4659
Conversation
} | ||
|
||
return true; | ||
}; |
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.
What about interpolation SCSS #{var}
?
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.
Isn't it #{$var}
?
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.
Oh, yes, what about $
and @
in css variable names, can these characters used?
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 couldn't get straight answer from the spec. But I tried in Chrome putting these symbols in different position in the custom property name, and all were invalid.
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.
Sounds good, approved
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!
But with this PR, we reduce usefulness of this rule for these users.
The community can create a scss/function-calc-no-invalid
plugin (and a less/function-calc-no-invalid
one etc). Each would cater to the more specific syntax of their respective languages.
True. Also, there are pieces of code after that PR, that handle most of use cases of variables and interpolations. I don't know where they are, but now it's a dead code. And this is the case most likely with every rule, where we started ignoring non-standard syntax. |
|
Thanks everyone involved for your contributions on this :) |
Fixes #4114, #4533.
Closes #4534.
@jeddy3 said:
To be honest, I don't think this is a good approach for users.
function-calc-no-invalid
catches many cases of invalidcalc
for preprocessor users. But with this PR, we reduce usefulness of this rule for these users.