Skip to content
This repository has been archived by the owner on Mar 30, 2024. It is now read-only.

Commit

Permalink
fix: selector-class-pattern regex for modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
mvsde committed Dec 31, 2022
1 parent 795f2fb commit dca7fad
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ module.exports = {
'selector-attribute-operator-space-after': 'never',
'selector-attribute-operator-space-before': 'never',
'selector-attribute-quotes': 'always',
'selector-class-pattern': ['^(u(-[a-z]+)?|is|has|([A-Z][a-z]+)+)(--?[a-z][A-Za-z]*)?$', {
'selector-class-pattern': ['^(u(-[a-z]+)?|is|has|([A-Z][a-z]+)+)(-[a-z][A-Za-z]*)?(--[a-z][A-Za-z]*)?$', {
message: 'Expected selector format ComponentName[-descendantName|--modifierName], u-[condition-]utilityName, {is|has}-stateName',
}],
'selector-combinator-space-after': 'always',
Expand Down
12 changes: 11 additions & 1 deletion test/selectors.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,17 @@
.ComponentName.is-state,
.ComponentName.is-stateName,
.ComponentName.has-state,
.ComponentName.has-stateName {
.ComponentName.has-stateName,

/* Subcomponent */
.Component-sub,
.Component-sub--modifier,
.Component-subComponent,
.Component-subComponent--modifier,
.ComponentName-sub,
.ComponentName-sub--modifier,
.ComponentName-subComponent,
.ComponentName-subComponent--modifier {
color: hotpink;
}

Expand Down

0 comments on commit dca7fad

Please sign in to comment.