10up-toolkit
10up-toolkit copied to clipboard
Stylelint custom-property-pattern doesn't fully support variables created by theme.json
Describe the bug
Related to https://github.com/10up/10up-toolkit/issues/300 and https://github.com/10up/10up-toolkit/pull/314
theme.json generates font size and font family variables with mixed kebab-case and wp--kebab--case, for example: --wp--preset--font-family--headline or --wp--preset--font-size--lg.
This throws stylelint error: Expected custom property name to be kebab-case or wp--kebab--case custom-property-pattern
Steps to Reproduce
- Add font size or font family variable in theme.json
- Use generated variable in theme CSS
- Stylelint throws error
Screenshots, screen recording, code snippet
No response
Environment information
No response
WordPress information
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Discussed in 10up-toolkit council meeting and we agreed to relax this rule.
@Antonio-Laguna would this be a breaking change? should we include it as part of v6/the next major of stylelint
@nicholasio I don't think so since it does relax the rule? This needs to be fixed though plus another minor thing I found around nesting for stylelint