Skip to content

Does not work with Sass interpolation #132

@ruedap

Description

@ruedap

This plugin does not seem to support Sass interpolation.

input.scss:

/** @define ComponentName */
.ComponentName {
  $ComponentName: &;

  &--modifierName {
    color: blue;

    #{$ComponentName} {  // <- Sass interpolation
      &-decendantName {
        color: red;
      }
    }
  }
}

postcss-bem-linter result:

input.scss
 9:7  ✖  Invalid component selector                   plugin/selector-bem-pattern
         ".ComponentName--modifierName
         #{$ComponentName}-decendantName"

output.css

/** @define ComponentName */
.ComponentName--modifierName {
  color: blue;
}
.ComponentName--modifierName .ComponentName-decendantName {
  color: red;
}

postcss-bem-linter result:

No errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions