Skip to content

Commit

Permalink
add css values inside expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
braver committed Feb 18, 2024
1 parent 2727cf0 commit 1850fe8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
15 changes: 15 additions & 0 deletions Syntaxes/SCSS.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 6 additions & 2 deletions Tests/syntax_test_scss.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1850fe8

Please sign in to comment.