diff --git a/Syntaxes/SCSS.sublime-syntax b/Syntaxes/SCSS.sublime-syntax index 6b55bf79..8772d494 100644 --- a/Syntaxes/SCSS.sublime-syntax +++ b/Syntaxes/SCSS.sublime-syntax @@ -198,7 +198,7 @@ contexts: push: selector-class-identifier scss-bem-selector: - - match: (\&)([-_]+{{ident}}) + - match: (\&)([-_]+({{ident}}|(?=#{))) # &--bem_ish selectors captures: 1: variable.language.parent.css diff --git a/Tests/syntax_test_scss.scss b/Tests/syntax_test_scss.scss index a0f5bcb5..53d744f9 100644 --- a/Tests/syntax_test_scss.scss +++ b/Tests/syntax_test_scss.scss @@ -1381,3 +1381,16 @@ $color2 : #f00; // ^^^^ meta.declaration.identifier.scss $color3 : #f00; // ^^^^ meta.declaration.identifier.scss + +//============================================================================= +// Bem-ish selectors with interpolation +// https://github.com/braver/Sass/issues/45 +//============================================================================= +&--test {} +//^^^^^ meta.selector.css entity.other.attribute-name.css +&--#{$test} {} +//^ meta.selector.css entity.other.attribute-name.css +.test & {} +// ^ meta.selector.css variable.language.parent.css +.test:not() & {} +// ^ meta.selector.css variable.language.parent.css