From 0e7bd38a9a5e08ff0b5b5ba21d981f15c698a4b3 Mon Sep 17 00:00:00 2001 From: vrugtehagel Date: Sat, 25 May 2024 12:27:08 +0200 Subject: [PATCH 1/4] Add view-transition psuedo elements and property --- CSS3.sublime-syntax | 73 ++++++++++++++++++++++++++++++++++++++++++ test/property-list.css | 3 ++ test/selectors.css | 14 ++++++++ 3 files changed, 90 insertions(+) diff --git a/CSS3.sublime-syntax b/CSS3.sublime-syntax index 6848ddf..b3f379c 100644 --- a/CSS3.sublime-syntax +++ b/CSS3.sublime-syntax @@ -4045,6 +4045,7 @@ contexts: - include: property-user-select - include: property-vector-effect - include: property-vertical-align + - include: property-view-transition-name - include: property-voice-balance - include: property-voice-duration - include: property-voice-family @@ -10507,6 +10508,20 @@ contexts: - include: baseline-source - include: stray-paren-or-semicolon + # CSS View Transitions Module Level 1 + property-view-transition-name: + - match: \b(view-transition-name)\s*(:) + captures: + 1: support.type.property-name.css + 2: punctuation.separator.key-value.css + push: + - meta_content_scope: meta.property-value.view-transition-name.css + - include: end-value + - match: \bnone{{b}} + scope: support.constant.property-value.css + - include: identifier + - include: stray-paren-or-semicolon + # CSS basic box model property-visibility: - match: \b(visibility)\s*(:) @@ -11260,6 +11275,7 @@ contexts: before| backdrop| after| + view-transition| -webkit-input-placeholder| -ms-input-placeholder| -moz-selection| @@ -11273,6 +11289,10 @@ contexts: - include: selector-pseudo-element-slotted - include: selector-pseudo-element-slot-blank - include: selector-pseudo-element-attr + - include: selector-pseudo-element-view-transition-group + - include: selector-pseudo-element-view-transition-old + - include: selector-pseudo-element-view-transition-new + - include: selector-pseudo-element-view-transition-image-pair - include: selector-pseudo-element-invalid selector-pseudo-element-attr: @@ -11333,6 +11353,54 @@ contexts: - include: identifier - include: stray-paren + selector-pseudo-element-view-transition-group: + - match: '((::)view-transition-group)(\()' + captures: + 1: entity.other.attribute-name.pseudo-element.css + 2: punctuation.definition.entity.pseudo-element.css + 3: punctuation.section.function.begin.css + push: + - meta_scope: meta.function.pseudo-element.view-transition-group.css + - include: end-func + - include: selector-pt-name + - include: stray-paren + + selector-pseudo-element-view-transition-old: + - match: '((::)view-transition-old)(\()' + captures: + 1: entity.other.attribute-name.pseudo-element.css + 2: punctuation.definition.entity.pseudo-element.css + 3: punctuation.section.function.begin.css + push: + - meta_scope: meta.function.pseudo-element.view-transition-old.css + - include: end-func + - include: selector-pt-name + - include: stray-paren + + selector-pseudo-element-view-transition-new: + - match: '((::)view-transition-new)(\()' + captures: + 1: entity.other.attribute-name.pseudo-element.css + 2: punctuation.definition.entity.pseudo-element.css + 3: punctuation.section.function.begin.css + push: + - meta_scope: meta.function.pseudo-element.view-transition-new.css + - include: end-func + - include: selector-pt-name + - include: stray-paren + + selector-pseudo-element-view-transition-image-pair: + - match: '((::)view-transition-image-pair)(\()' + captures: + 1: entity.other.attribute-name.pseudo-element.css + 2: punctuation.definition.entity.pseudo-element.css + 3: punctuation.section.function.begin.css + push: + - meta_scope: meta.function.pseudo-element.view-transition-image-pair.css + - include: end-func + - include: selector-pt-name + - include: stray-paren + selector-pseudo-element-slotted: - match: '((::)slotted)(\()' captures: @@ -11357,6 +11425,11 @@ contexts: # match nonspecific identifiers. - include: selector-type + selector-pt-name: + - match: '\*' + scope: entity.name.tag.wildcard.css + - include: identifier + selector-type: - include: selector-type-deprecated - match: '(?x) diff --git a/test/property-list.css b/test/property-list.css index e9b8233..c8eac98 100644 --- a/test/property-list.css +++ b/test/property-list.css @@ -6364,6 +6364,9 @@ vertical-align: 4px; vertical-align: 20% ; + view-transition-name: none; + view-transition-name: ident; + visibility: initial; visibility: inherit; visibility: unset; diff --git a/test/selectors.css b/test/selectors.css index e2cda56..c5b6ff2 100644 --- a/test/selectors.css +++ b/test/selectors.css @@ -55,6 +55,20 @@ div:first-line {} ::selection {} ::shadow {} ::spelling-error {} +::view-transition {} + +::view-transition-group(*) {} +::view-transition-group(root) {} +::view-transition-group(ident) {} +::view-transition-old(*) {} +::view-transition-old(root) {} +::view-transition-old(ident) {} +::view-transition-new(*) {} +::view-transition-new(root) {} +::view-transition-new(ident) {} +::view-transition-image-pair(*) {} +::view-transition-image-pair(root) {} +::view-transition-image-pair(ident) {} /* -moz- prefixed pseudo-classes */ From 680182c147eca4dbd550330a2adb68bb51ea1cee Mon Sep 17 00:00:00 2001 From: vrugtehagel Date: Tue, 28 May 2024 21:40:14 +0200 Subject: [PATCH 2/4] Add view-transition-class --- CSS3.sublime-syntax | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CSS3.sublime-syntax b/CSS3.sublime-syntax index b3f379c..df43cbd 100644 --- a/CSS3.sublime-syntax +++ b/CSS3.sublime-syntax @@ -4046,6 +4046,7 @@ contexts: - include: property-vector-effect - include: property-vertical-align - include: property-view-transition-name + - include: property-view-transition-class - include: property-voice-balance - include: property-voice-duration - include: property-voice-family @@ -10522,6 +10523,20 @@ contexts: - include: identifier - include: stray-paren-or-semicolon + # CSS View Transitions Module Level 1 + property-view-transition-class: + - match: \b(view-transition-class)\s*(:) + captures: + 1: support.type.property-name.css + 2: punctuation.separator.key-value.css + push: + - meta_content_scope: meta.property-value.view-transition-class.css + - include: end-value + - match: \bnone{{b}} + scope: support.constant.property-value.css + - include: identifier + - include: stray-paren-or-semicolon + # CSS basic box model property-visibility: - match: \b(visibility)\s*(:) From eb5916e2bb0c0ded5f3fff328802cc12ed716792 Mon Sep 17 00:00:00 2001 From: vrugtehagel Date: Tue, 28 May 2024 21:41:21 +0200 Subject: [PATCH 3/4] Reorder and add some tests for view-transition-class --- CSS3.sublime-syntax | 14 +++++++------- test/property-list.css | 2 ++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CSS3.sublime-syntax b/CSS3.sublime-syntax index df43cbd..d89a1b4 100644 --- a/CSS3.sublime-syntax +++ b/CSS3.sublime-syntax @@ -4045,8 +4045,8 @@ contexts: - include: property-user-select - include: property-vector-effect - include: property-vertical-align - - include: property-view-transition-name - include: property-view-transition-class + - include: property-view-transition-name - include: property-voice-balance - include: property-voice-duration - include: property-voice-family @@ -10510,13 +10510,13 @@ contexts: - include: stray-paren-or-semicolon # CSS View Transitions Module Level 1 - property-view-transition-name: - - match: \b(view-transition-name)\s*(:) + property-view-transition-class: + - match: \b(view-transition-class)\s*(:) captures: 1: support.type.property-name.css 2: punctuation.separator.key-value.css push: - - meta_content_scope: meta.property-value.view-transition-name.css + - meta_content_scope: meta.property-value.view-transition-class.css - include: end-value - match: \bnone{{b}} scope: support.constant.property-value.css @@ -10524,13 +10524,13 @@ contexts: - include: stray-paren-or-semicolon # CSS View Transitions Module Level 1 - property-view-transition-class: - - match: \b(view-transition-class)\s*(:) + property-view-transition-name: + - match: \b(view-transition-name)\s*(:) captures: 1: support.type.property-name.css 2: punctuation.separator.key-value.css push: - - meta_content_scope: meta.property-value.view-transition-class.css + - meta_content_scope: meta.property-value.view-transition-name.css - include: end-value - match: \bnone{{b}} scope: support.constant.property-value.css diff --git a/test/property-list.css b/test/property-list.css index c8eac98..289e2ef 100644 --- a/test/property-list.css +++ b/test/property-list.css @@ -6364,6 +6364,8 @@ vertical-align: 4px; vertical-align: 20% ; + view-transition-class: none; + view-transition-class: ident; view-transition-name: none; view-transition-name: ident; From cfb532a7287f7d790b753e5c590a3a8eb25239cc Mon Sep 17 00:00:00 2001 From: vrugtehagel Date: Tue, 28 May 2024 21:42:13 +0200 Subject: [PATCH 4/4] Add newline between tests for the different properties --- test/property-list.css | 1 + 1 file changed, 1 insertion(+) diff --git a/test/property-list.css b/test/property-list.css index 289e2ef..a80240e 100644 --- a/test/property-list.css +++ b/test/property-list.css @@ -6366,6 +6366,7 @@ view-transition-class: none; view-transition-class: ident; + view-transition-name: none; view-transition-name: ident;