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 custom-property-no-missing-var-function
false positives for properties that can contain author-defined identifiers
#5742
Comments
@CyanSalt Thanks for using the template! Not reporting access without |
Sorry for taking so long to reply. As far as I know, CSS Houdini is still in draft form and only Blink supports the relevant features. But as we can see in the https://stylelint.io/user-guide/rules/list/custom-property-no-missing-var-function/ documentation there are also examples of As I understand the spec, For this, you can see the first example in the CSS Houdini draft, which shows exactly how this syntax is used in References: |
@CyanSalt Thank you for the detailed explanation! SGTM 👍🏼 |
I've labeled the issue as ready to implement. Please consider contributing if you have time. |
As a side note, I found that almost all user-defined at-rules in the CSS standard support the As a possibly incomplete list, the properties I've gathered so far are as follows:
For these properties, I think the more common use case is probably still custom properties wrapped in As a rough design, perhaps we could provide |
custom-property-no-missing-var-function
with transition
Sorry, I missed this.
Yes, that was the original reason for limiting this rule to defined custom properties. However, we didn't consider the scenario where a custom property is defined but intentionally not used in a Thanks for drawing up the list in #5742 (comment). Ideally, we'd ignore just the |
custom-property-no-missing-var-function
false positives for properties that can contain author-defined identifiers
I'm revisiting this old issue, but still valid. I'll address it according to the suggestion on #5742 (comment). |
What is the problem you're trying to solve?
Thanks to the CSS Houdini API, the property name of a custom property could appear in the value of some declarations, such as
transition
(or more precisely,transition-property
). However, the currentcustom-property-no-missing-var-function
rule will report errors for these custom property names that are not wrapped invar()
.Online demo
What solution would you like to see?
One possibility is to not report
transition
, etc. by default, but this could also produce breaking changes.It is also possible to add options to the rule to ignore certain property names, as we did in
property-no-vendor-prefix
.The text was updated successfully, but these errors were encountered: