Skip to content

Commit

Permalink
Updating rule to work with WP style (#314)
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio-Laguna committed Aug 2, 2023
1 parent aa19110 commit b172081
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/sixty-seas-chew.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@10up/stylelint-config": patch
---

Fixes validation for `--wp--some--property` for custom properties
Fixes usage of `currentcolor` vs `currentColor`
8 changes: 7 additions & 1 deletion packages/stylelint-config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
rules: {
'scale-unlimited/declaration-strict-value': [
'/color/',
{ ignoreValues: ['currentColor', 'inherit', 'initial', 'transparent', 'unset'] },
{ ignoreValues: ['currentcolor', 'inherit', 'initial', 'transparent', 'unset'] },
],
'order/properties-alphabetical-order': true,
'function-url-quotes': 'always',
Expand All @@ -13,5 +13,11 @@ module.exports = {
'selector-nested-pattern': ['^&'],
'no-descending-specificity': null,
'at-rule-no-unknown': [true, { ignoreAtRules: ['mixin', 'define-mixin'] }],
'custom-property-pattern': [
'^([a-z][a-z0-9]*)(-[a-z0-9]+)*$|^wp--([a-z][a-z0-9]*)(--[a-z0-9]+)*$',
{
message: 'Expected custom property name to be kebab-case or wp--kebab--case',
},
],
},
};

0 comments on commit b172081

Please sign in to comment.