From a9ea500e923fadb5561c2d19ff053081cba22f3a Mon Sep 17 00:00:00 2001 From: Koen Lagveen Date: Sat, 17 Feb 2024 18:15:19 +0100 Subject: [PATCH] handle interpolation in selectors --- Syntaxes/SCSS.sublime-syntax | 3 ++- Tests/syntax_test_scss.scss | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Syntaxes/SCSS.sublime-syntax b/Syntaxes/SCSS.sublime-syntax index 90934460..0546dca3 100644 --- a/Syntaxes/SCSS.sublime-syntax +++ b/Syntaxes/SCSS.sublime-syntax @@ -119,7 +119,8 @@ contexts: pop: 1 selector-body: - - meta_append: true + - meta_prepend: true + - include: scss-interpolation - include: scss-placeholder-selector ###[ CSS PROPERTY LISTS ]###################################################### diff --git a/Tests/syntax_test_scss.scss b/Tests/syntax_test_scss.scss index 17d724d2..5639d99a 100644 --- a/Tests/syntax_test_scss.scss +++ b/Tests/syntax_test_scss.scss @@ -380,6 +380,9 @@ $variable: first global value; //============================================================================= @mixin corner-icon($name, $top-or-bottom, $left-or-right) { .icon-#{$name} { +//^^^^^^ entity.other.attribute-name.class.css +// ^^^^^^^ meta.interpolation.scss +// ^^^^^ variable.other.scss background-image: url("/icons/#{$name}.svg"); // ^^^^^^^^ meta.interpolation.scss position: absolute; @@ -670,6 +673,8 @@ nav ul { @for $i from 0 to length($selectors) { #{nth($selectors, $i + 1)} { +// ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.interpolation.scss +// ^ meta.selector position: absolute; height: $height; margin-top: $i * $height;