Skip to content

Commit

Permalink
Merge pull request #369 from 10up/fix/wp-custom-property-pattern
Browse files Browse the repository at this point in the history
Fix: `custom-property-pattern` to also match single `-` separators
  • Loading branch information
fabiankaegy authored Feb 20, 2024
2 parents abc5afb + 5734ef9 commit 5f69847
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/funny-dogs-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@10up/stylelint-config": patch
---

Update `custom-property-pattern` regular expression to also match custom properties that use a singular `-` as a group separator
2 changes: 1 addition & 1 deletion packages/stylelint-config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = {
},
],
'custom-property-pattern': [
'^([a-z][a-z0-9]*)(-[a-z0-9]+)*$|^wp--([a-z][a-z0-9]*)(--[a-z0-9]+)*$',
'^([a-z][a-z0-9]*)(-[a-z0-9]+)*$|^wp--([a-z][a-z0-9]*)([-]{1,2}[a-z0-9]+)*$',
{
message: 'Expected custom property name to be kebab-case or wp--kebab--case',
},
Expand Down

0 comments on commit 5f69847

Please sign in to comment.