From 1850fe8b2978b064cca71cf4ba1960da0af68f64 Mon Sep 17 00:00:00 2001 From: Koen Lagveen Date: Sun, 18 Feb 2024 20:13:41 +0100 Subject: [PATCH] add css values inside expressions --- Syntaxes/SCSS.sublime-syntax | 15 +++++++++++++++ Tests/syntax_test_scss.scss | 8 ++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/Syntaxes/SCSS.sublime-syntax b/Syntaxes/SCSS.sublime-syntax index 41c19ece..5b9579bb 100644 --- a/Syntaxes/SCSS.sublime-syntax +++ b/Syntaxes/SCSS.sublime-syntax @@ -202,6 +202,21 @@ contexts: - include: scss-operators - include: sass-namespaced-functions + # and most normal css values + # - include: comma-delimiters + # - include: arithmetic-operators + # - include: important-operators + # - include: vendor-prefixes + - include: builtin-functions + - include: color-values + - include: line-name-lists + - include: unicode-ranges + - include: numeric-constants + - include: quoted-strings + - include: none-constants + - include: constants-or-functions + # - include: illegal-groups + scss-expression-block: - match: '\((?!.*:)' # if there is an : in it, assume it's a map captures: diff --git a/Tests/syntax_test_scss.scss b/Tests/syntax_test_scss.scss index 6deb633c..514d4db0 100644 --- a/Tests/syntax_test_scss.scss +++ b/Tests/syntax_test_scss.scss @@ -471,7 +471,7 @@ $variable: first global value; //^^^^^^ keyword.control.directive.module.scss //<- punctuation.definition.keyword.scss // ^^^^ keyword.control.show-hide.scss -// ^^^^^^^^^^ meta.generic-name.scss +// ^^^^^^^^^^ support.constant.property-value // ^ punctuation.separator.sequence.css // ^^^^^^^^^^^^^^^^^^^^ variable.other.scss // ^ punctuation.terminator.rule.css @@ -617,7 +617,7 @@ nav ul { // ^ punctuation.section.group.begin.scss // ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call.arguments.scss // ^^^ support.function.url.css -// ^^^^^^^^^^^^^^^^ meta.path.url.css +// ^^^^^^^^^^^^^^^^ meta.string.css // ^ punctuation.separator.sequence.css // ^ constant.numeric.value.css // ^ punctuation.section.group.end.scss @@ -1325,6 +1325,10 @@ $transition-speed: math.div(1s, 50px); // https://sass-lang.com/documentation/operators/ //============================================================================= @debug 1 + 2 * 3 == 1 + (2 * 3); // true +// ^^^^^^^ meta.group.scss +// ^ constant.numeric +// ^ keyword.operator +// ^ constant.numeric @debug true or false and false == true or (false and false); // true // ^^^^ constant.language.boolean.true.scss // ^^ keyword.operator.scss