Skip to content

Commit

Permalink
Merge branch 'master' into st4107
Browse files Browse the repository at this point in the history
  • Loading branch information
deathaxe committed Oct 31, 2024
2 parents 7a71f3c + 768ed86 commit 9fb2531
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ SCSS extends Sublime Text's CSS syntax definition as of ST4149.

If SCSS syntax highlighting doesn't work and console displays syntax errors,

1. check if CSS package enabled.
1. check if CSS package is enabled.
2. remove any out-dated syntax override.

### Enable CSS package
Expand Down
2 changes: 1 addition & 1 deletion Syntaxes/SCSS.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// Controls what scopes default completions will be provided in.
// Can be a list of strings which are joined before matching.
"default_completions_selector": "source.scss",
"default_completions_selector": "source.scss - source.scss comment - source.scss meta.embedded - source.scss source - source.scss text",

// Default separators except `-`
"word_separators": "/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?",
Expand Down
2 changes: 1 addition & 1 deletion Syntaxes/Sass.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// Controls what scopes default completions will be provided in.
// Can be a list of strings which are joined before matching.
"default_completions_selector": "source.sass",
"default_completions_selector": "source.sass - source.sass comment - source.sass meta.embedded - source.sass source - source.sass text",

// Default separators except `-`
"word_separators": "/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?",
Expand Down
20 changes: 11 additions & 9 deletions Syntaxes/Sass.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -1363,27 +1363,29 @@ contexts:
- match: '{{combinators}}{2,}|\|{3,}'
scope: invalid.illegal.combinator.css

# CSS modules
- match: '\s*(:)(local|global)(?=\()'
scope: meta.selector.css entity.other.pseudo-class.css-modules.css
# CSS modules: global, local
# also used by various other frameworks
- match: '\s*((:)(?i:global|local))(?=\()'
captures:
1: punctuation.definition.entity.css
1: entity.other.pseudo-class.css
2: punctuation.definition.entity.css
push:
- meta_scope: meta.selector.css meta.function-call.css
- meta_scope: meta.function-call.css
- match: '\('
scope: punctuation.section.group.begin.css
push:
- meta_scope: meta.group.css
- meta_content_scope: meta.selector.css
- match: '\)'
scope: punctuation.section.group.end.css
pop: 1
- include: quoted-strings
- include: selector-content
- match: ''
pop: 1
- match: '\s*(:)(local|global)'
scope: meta.selector.css entity.other.pseudo-class.css-modules.css
- match: '\s*((:)(?i:global|local))\b'
captures:
1: punctuation.definition.entity.css
1: entity.other.pseudo-class.css
2: punctuation.definition.entity.css

selector-end:
- match: (?=\s*[;@(){}]|$)
Expand Down
18 changes: 12 additions & 6 deletions Tests/syntax_test_sass.sass
Original file line number Diff line number Diff line change
Expand Up @@ -276,17 +276,23 @@ input:not([type="radio"]):not(h1):not(custom-element):not(%placeholder), select,
Global vs. local scope: https://github.com/css-modules/css-modules#exceptions
*/
.localA :global .global-b .global-c :local(.localD.localE::before) .global-d
// ^^^^^^^ entity.other.pseudo-class.css-modules
// ^^^^^^ entity.other.pseudo-class.css-modules
// ^ meta.function-call.css meta.group.css punctuation.section.group.begin.css
// ^^^^^^^^^^^^^^^^^^^^^^ meta.selector
// <- meta.selector.css - meta.selector meta.selector
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.selector.css - meta.selector meta.selector
// ^^^^^^^^^^^^^^^^^^^^^^ meta.selector.css meta.selector.css
// ^^^^^^^^^^^ meta.selector.css - meta.selector meta.selector
// ^^^^^^^ entity.other.pseudo-class
// ^^^^^^ entity.other.pseudo-class
// ^ punctuation.section.group.begin.css
// ^^^^^^^^^^^^^^ entity.other.attribute-name.class.css
// ^^ punctuation.definition.pseudo-element.css
// ^^^^^^ entity.other.pseudo-element.css
// ^ punctuation.section.group.end.css
:global // global blocks
// ^^^^ entity.other.pseudo-class.css-modules
// ^^^^ entity.other.pseudo-class
.global-class-name
color: green
:local // local blocks
// ^^^ entity.other.pseudo-class.css-modules
// ^^^ entity.other.pseudo-class
.global-class-name
color: green
Expand Down

0 comments on commit 9fb2531

Please sign in to comment.