Skip to content

Commit

Permalink
Improve constants interpolation support
Browse files Browse the repository at this point in the history
  • Loading branch information
deathaxe committed Mar 10, 2024
1 parent 37b280d commit cf20d5f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Syntaxes/SCSS.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ variables:

tag_name_begin: (?=[[:alpha:]]|#{)

lang_range_begin: (?={{nmstart}}|\*|#{)
unquoted_url_begin: (?=[[:alnum:]/]|#{)
lang_range_begin: (?={{ident_start}}|\*)
unquoted_url_begin: (?={{ident_start}}|/)

# SCSS variables

Expand Down Expand Up @@ -443,9 +443,12 @@ contexts:
- meta_include_prototype: false
- meta_scope: meta.string.css string.unquoted.css
- include: scss-string-interpolations
- match: '{{break}}(?!\s+{{ident_start}})'
# allow unquoted space separated font names
- match: (?!\s+{{ident_start}}){{break}}
pop: 1
# function call ahead, skip font name
- match: (?=\s+{{ident}}\()
pop: 1
# consume unicode escapes and possibly following whitespace
- match: '{{unicode}}'

language-ranges:
Expand Down
7 changes: 7 additions & 0 deletions Tests/syntax_test_css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2634,6 +2634,13 @@
font: sans serif;
/* ^^^^^^^^^^ meta.string.css string.unquoted.css */
font: san\73 -\73 erif;
/* ^^^^^^^^^^^^^^^^ meta.string.css string.unquoted.css */
font: sans serif var(--name);
/* ^^^^^^^^^^ meta.string.css string.unquoted.css */
/* ^^^^^^^^^^^ meta.function-call */
font: inherit;
/* ^^^^^^^ support - string */
Expand Down

0 comments on commit cf20d5f

Please sign in to comment.