-
-
Notifications
You must be signed in to change notification settings - Fork 929
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 shorthand-property-no-redundant-values
false negatives for var()
#7656
Comments
@gregmatys Thanks for the report with the reproducible demo. This is a bug. 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. |
shorthand-property-no-redundant-values
doesn't work with var()
shorthand-property-no-redundant-values
false negatives for var()
Do we allow the erasion of e.g. /* --padding is 0 */
padding: 0 var(--padding) 0; to padding: 0; or without eval /* --padding is unknown */
padding: 0 var(--padding) 0; to padding: 0 var(--padding); ? The latter is safer because it keeps |
"without eval" makes sense to me. |
without evaluation for sure |
I just opened PR #7657. It supports not only |
🤔 Is it an issue that with :root {
--padding: 20px;
}
@media screen {
:root {
--padding: 20px 5px;
}
}
.a {
padding: 0 var(--padding) 0; /* unknown what --padding actually is */
}
.b {
padding: 0 20px 5px 0; /* no error */
}
.c {
padding: 0 20px 0; /* Expected "0 20px 0" to be "0 20px" */
} |
To me that's a blocker even if it eval the (re)declarations of the current file. The resetting cannot be ruled out for 2 reasons:
tl;dr: IMHO it should be ignored The PR could add support for functions like |
In that case we should probably make that explicit behavior by adding a test case for it. I agree that whenever |
Thanks for the feedback. I missed cases like I will continue to work on PR #7657 to exclude I'm closing this issue. |
Thanks for your work on that issue. You're right it's hard to precisely exclude the |
What minimal example or steps are needed to reproduce the bug?
What minimal configuration is needed to reproduce the bug?
How did you run Stylelint?
Demo
Which Stylelint-related dependencies are you using?
json { "stylelint": "15.6.0" }
What did you expect to happen?
fix redundant values
What actually happened?
nothing
Do you have a proposal to fix the bug?
--
The text was updated successfully, but these errors were encountered: