diff --git a/CSS/CSS.sublime-syntax b/CSS/CSS.sublime-syntax index 3d2210e13e..1978a182c1 100644 --- a/CSS/CSS.sublime-syntax +++ b/CSS/CSS.sublime-syntax @@ -387,6 +387,7 @@ contexts: - include: at-page - include: at-page-margin - include: at-property + - include: at-scope - include: at-scroll-timeline - include: at-other @@ -406,6 +407,7 @@ contexts: - include: at-page - include: at-page-margin - include: at-property + - include: at-scope - include: at-scroll-timeline - include: at-other @@ -892,6 +894,50 @@ contexts: - include: comments - include: else-pop +###[ SCOPE AT-RULE ]########################################################### + + # @scope + # https://developer.mozilla.org/en-US/docs/Web/CSS/@scope + at-scope: + - match: (@)(?i:scope){{break}} + scope: keyword.control.directive.css + captures: + 1: punctuation.definition.keyword.css + push: + - at-scope-selector-meta + - maybe-property-list + - at-scope-selector-to + - at-scope-selector-group + + at-scope-selector-meta: + - meta_include_prototype: false + - meta_scope: meta.at-rule.scope.css + - include: immediately-pop + + at-scope-selector-to: + - meta_include_prototype: false + - match: to{{break}} + scope: keyword.other.css + set: at-scope-selector-group + - include: comments + - include: else-pop + + at-scope-selector-group: + - meta_include_prototype: false + - match: \( + scope: punctuation.section.group.begin.css + set: at-scope-selector-group-body + - include: comments + - include: else-pop + + at-scope-selector-group-body: + - meta_scope: meta.group.css + - meta_content_scope: meta.selector.css + - match: \) + scope: punctuation.section.group.end.css + pop: 1 + - include: selector-body + ###[ SCROLL-TIMELINE AT-RULE ]################################################# # @scroll-timeline diff --git a/CSS/syntax_test_css.css b/CSS/syntax_test_css.css index af8ee09953..e98b23b5ef 100644 --- a/CSS/syntax_test_css.css +++ b/CSS/syntax_test_css.css @@ -1554,6 +1554,91 @@ /* ^ punctuation.terminator.rule.css */ } + @scope +/* ^^^^^^ meta.at-rule.scope.css keyword.control.directive.css */ + + @scope {} +/* ^^^^^^^^^ meta.at-rule.scope.css */ +/* ^^^^^^ keyword.control.directive.css */ +/* ^^ meta.property-list.css meta.block.css */ + + @scope to ; +/* ^^^^^^^^^^ meta.at-rule.scope.css */ +/* ^^^^^^ keyword.control.directive.css */ +/* ^^ keyword.other.css */ +/* ^ punctuation.terminator.rule.css */ + + @scope () {} +/* ^^^^^^^^^^^^ meta.at-rule.scope.css */ +/* ^^^^^^ keyword.control.directive.css */ +/* ^^ meta.group.css */ +/* ^^ meta.property-list.css meta.block.css */ + + @scope () () {} +/* ^^^^^^^^^^ meta.at-rule.scope.css */ +/* ^^^^^ - meta.at-rule */ +/* ^^^^^^ keyword.control.directive.css */ +/* ^^ meta.group.css */ +/* ^^ invalid.illegal.unexpected-token.css */ +/* ^^ meta.property-list.css meta.block.css */ + + @scope () to () {} +/* ^^^^^^^^^^^^^^^^^^ meta.at-rule.scope.css */ +/* ^^ meta.group.css */ +/* ^^ meta.group.css */ +/* ^^ meta.property-list.css meta.block.css */ +/* ^ punctuation.definition.keyword.css */ +/* ^^^^^^ keyword.control.directive.css */ +/* ^ punctuation.section.group.begin.css */ +/* ^ punctuation.section.group.end.css */ +/* ^^ keyword.other.css */ +/* ^ punctuation.section.group.begin.css */ +/* ^ punctuation.section.group.end.css */ +/* ^ punctuation.section.block.begin.css */ +/* ^ punctuation.section.block.end.css */ + + @scope /**/ () /**/ to /**/ () /**/ {} +/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.at-rule.scope.css */ +/* ^^ meta.group.css */ +/* ^^ meta.group.css */ +/* ^^ meta.property-list.css meta.block.css */ +/* ^ punctuation.definition.keyword.css */ +/* ^^^^^^ keyword.control.directive.css */ +/* ^^^^ comment.block.css */ +/* ^ punctuation.section.group.begin.css */ +/* ^ punctuation.section.group.end.css */ +/* ^^^^ comment.block.css */ +/* ^^ keyword.other.css */ +/* ^^^^ comment.block.css */ +/* ^ punctuation.section.group.begin.css */ +/* ^ punctuation.section.group.end.css */ +/* ^^^^ comment.block.css */ +/* ^ punctuation.section.block.begin.css */ +/* ^ punctuation.section.block.end.css */ + + @scope (.class) to (.limit > *) {} +/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.at-rule.scope.css */ +/* ^ meta.group.css - meta.selector */ +/* ^^^^^^ meta.at-rule.scope.css meta.group.css meta.selector.css */ +/* ^ meta.group.css - meta.selector */ +/* ^ meta.group.css - meta.selector */ +/* ^^^^^^^^^^ meta.at-rule.scope.css meta.group.css meta.selector.css */ +/* ^ meta.group.css - meta.selector */ +/* ^^ meta.property-list.css meta.block.css */ +/* ^ punctuation.definition.keyword.css */ +/* ^^^^^^ keyword.control.directive.css */ +/* ^ punctuation.section.group.begin.css */ +/* ^^^^^^ entity.other.attribute-name.class.css */ +/* ^ punctuation.section.group.end.css */ +/* ^^ keyword.other.css */ +/* ^ punctuation.section.group.begin.css */ +/* ^^^^^^ entity.other.attribute-name.class.css */ +/* ^ keyword.operator.combinator.css */ +/* ^ constant.other.wildcard.asterisk.css */ +/* ^ punctuation.section.group.end.css */ +/* ^ punctuation.section.block.begin.css */ +/* ^ punctuation.section.block.end.css */ + @scroll-timeline /* ^^^^^^^^^^^^^^^^^ meta.at-rule.scroll-timeline.css */ /* ^ keyword.control.directive.css punctuation.definition.keyword.css */