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 function-linear-gradient-no-nonstandard-direction
false positives for <color-interpolation-method>
#6951
Comments
@crystalfp Thanks for the report with the reproducible example! I can reproduce it with this demo. 👍🏼 The CSS Images Module Level 4 spec says:
So the I've labeled the issue as ready to implement. Please consider contributing if you have time. There are steps on how to fix a bug in a rule in the Developer guide. |
function-linear-gradient-no-nonstandard-direction
false positives for <color-interpolation-method>
argument
function-linear-gradient-no-nonstandard-direction
false positives for <color-interpolation-method>
argumentfunction-linear-gradient-no-nonstandard-direction
false positives for <color-interpolation-method>
This is not trivial to fix because this rule supports vendor prefixed variants of
This was later changed to The
I think we should move the current implementation into a Then add a new check function that only supports the standard syntax. In the standard syntax check we would look for the first meaningful argument after a |
@romainmenke Thank you for investigating. If I remember correctly, we added this rule to encourage people to move:
Even though a browser may successfully render either. I suspect most people use modern direction syntax these days. Could we fix the false positive by simply returning early if the first argument is |
These arguments can appear in any order :
We could return early if any argument before the first comma is the |
Interesting. I thought that might be the case, but I couldn't see an example in the spec.
SGTM. It seems like the simplest solution to the false positive. |
What steps are needed to reproduce the bug?
What Stylelint configuration is needed to reproduce the bug?
How did you run Stylelint?
stylelint *.css --config .stylelintrc.yaml
Which version of Stylelint or dependencies are you using?
15.8.0
What did you expect to happen?
No problem to be reported
What actually happened?
Does the bug relate to non-standard syntax?
This is a recent syntax about color management in CSS
Proposal to fix the bug
No response
The text was updated successfully, but these errors were encountered: