From c03b1b7c428eb2cf94c57a568381f2beda016090 Mon Sep 17 00:00:00 2001 From: Koen Lagveen Date: Sun, 25 Feb 2024 10:32:18 +0100 Subject: [PATCH] separate bem-ish selectors --- Syntaxes/SCSS.sublime-syntax | 17 ++++++++++------- Tests/syntax_test_scss.scss | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Syntaxes/SCSS.sublime-syntax b/Syntaxes/SCSS.sublime-syntax index aed8766e..f347b01d 100644 --- a/Syntaxes/SCSS.sublime-syntax +++ b/Syntaxes/SCSS.sublime-syntax @@ -122,11 +122,7 @@ contexts: - meta_prepend: true - include: scss-interpolation - include: scss-placeholder-selector - - match: (\&)([-_]+{{ident}}) - # &--bem_ish selectors - captures: - 1: variable.language.parent.css - 2: entity.other.attribute-name.css + - include: scss-bem-selector ###[ CSS PROPERTY LISTS ]###################################################### @@ -183,7 +179,7 @@ contexts: - meta_append: true - include: scss-expression-basic -###[ SCSS DEFAULT/GLOBAL VALUES ]############################################### +###[ SCSS DEFAULT/GLOBAL VALUES ]############################################## scss-default-operators: - match: \!\s*(?i:default){{break}} @@ -193,7 +189,7 @@ contexts: - match: \!\s*(?i:global){{break}} scope: keyword.other.global.scss -###[ SCSS PLACEHOLDER SELECTOR ]############################################### +###[ SCSS SELECTORS ]########################################################## scss-placeholder-selector: - match: \% @@ -201,6 +197,13 @@ contexts: # has same basic properties as a classname push: selector-class-identifier + scss-bem-selector: + - match: (\&)([-_]+{{ident}}) + # &--bem_ish selectors + captures: + 1: variable.language.parent.css + 2: entity.other.attribute-name.css + ###[ SCSS EXPRESSIONS ]######################################################## scss-expression-basic: diff --git a/Tests/syntax_test_scss.scss b/Tests/syntax_test_scss.scss index 446f2fa1..12953268 100644 --- a/Tests/syntax_test_scss.scss +++ b/Tests/syntax_test_scss.scss @@ -201,7 +201,7 @@ title: Blogging Like a Hacker //============================================================================= .enlarge { font-size: 14px; - transition: { + transition: blue { property: font-size; duration: 4s; delay: 2s;