From e945bc4f556b284cb226de8c136715d370fad078 Mon Sep 17 00:00:00 2001 From: deathaxe Date: Fri, 4 Oct 2024 14:42:03 +0200 Subject: [PATCH 1/3] Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 00af258d..ead7b00e 100644 --- a/README.md +++ b/README.md @@ -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 From 2b024c209b4f5e440cb7181908ecb5e50714ad5e Mon Sep 17 00:00:00 2001 From: deathaxe Date: Sat, 12 Oct 2024 16:50:02 +0200 Subject: [PATCH 2/3] Adjust completion selectors related with https://github.com/sublimehq/Packages/pull/4056. --- Syntaxes/SCSS.sublime-settings | 2 +- Syntaxes/Sass.sublime-settings | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Syntaxes/SCSS.sublime-settings b/Syntaxes/SCSS.sublime-settings index f98a4ada..2fcc796e 100644 --- a/Syntaxes/SCSS.sublime-settings +++ b/Syntaxes/SCSS.sublime-settings @@ -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": "/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?", diff --git a/Syntaxes/Sass.sublime-settings b/Syntaxes/Sass.sublime-settings index c0620c01..6474cb07 100644 --- a/Syntaxes/Sass.sublime-settings +++ b/Syntaxes/Sass.sublime-settings @@ -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": "/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?", From 768ed864aaa1ee609e04e62ac2897debe6f3dfa1 Mon Sep 17 00:00:00 2001 From: deathaxe Date: Thu, 31 Oct 2024 13:30:49 +0100 Subject: [PATCH 3/3] Fix CSS Module support in Sass 1. fixes duplicate meta.selector scopes of :local and :global pseudo classes. 2. adds selector scoping within argument lists 3. removes `.css-modules` sub-scope name Note: Support for `:global()` and `:local()` in SCSS comes with CSS as of ST4180. --- Syntaxes/Sass.sublime-syntax | 20 +++++++++++--------- Tests/syntax_test_sass.sass | 18 ++++++++++++------ 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/Syntaxes/Sass.sublime-syntax b/Syntaxes/Sass.sublime-syntax index e59e27d5..8283ca5f 100644 --- a/Syntaxes/Sass.sublime-syntax +++ b/Syntaxes/Sass.sublime-syntax @@ -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*[;@(){}]|$) diff --git a/Tests/syntax_test_sass.sass b/Tests/syntax_test_sass.sass index 7857f494..0b47d6bc 100644 --- a/Tests/syntax_test_sass.sass +++ b/Tests/syntax_test_sass.sass @@ -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