diff --git a/.changeset/funny-dogs-learn.md b/.changeset/funny-dogs-learn.md new file mode 100644 index 00000000..25c33fcd --- /dev/null +++ b/.changeset/funny-dogs-learn.md @@ -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 diff --git a/packages/stylelint-config/index.js b/packages/stylelint-config/index.js index 432659ae..f4fd1d3c 100644 --- a/packages/stylelint-config/index.js +++ b/packages/stylelint-config/index.js @@ -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', },