Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add view-transition psuedo elements and property #208

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions CSS3.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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*(:)
Expand Down Expand Up @@ -11260,6 +11275,7 @@ contexts:
before|
backdrop|
after|
view-transition|
-webkit-input-placeholder|
-ms-input-placeholder|
-moz-selection|
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions test/property-list.css
Original file line number Diff line number Diff line change
Expand Up @@ -6364,6 +6364,9 @@
vertical-align: 4px;
vertical-align: 20% ;

view-transition-name: none;
view-transition-name: ident;

visibility: initial;
visibility: inherit;
visibility: unset;
Expand Down
14 changes: 14 additions & 0 deletions test/selectors.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down
Loading