Skip to content

Commit 3d57a4c

Browse files
committed
Specify view-transition-nane: match-element
1 parent a48d4f4 commit 3d57a4c

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

css-view-transitions-2/Overview.bs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,14 +537,35 @@ spec:css2; type:dfn; text:viewport
537537
: <dfn>none</dfn>
538538
:: The [=/element=] will not participate independently in a view transition.
539539

540+
: <dfn>match-element</dfn>
541+
:: The [=/element=] will participate in the transition
542+
with a user-agent generated name that is unique to the [=/element=].
543+
544+
<div class="example">
545+
```html
546+
<style>
547+
.card {
548+
view-transition-name: match-element;
549+
}
550+
</style>
551+
<div id=e1 class=card>Card 1</div>
552+
<div id=e2 class=card>Card 2</div>
553+
```
554+
In this example, both `#e1` and `#e2` participate in the transition and match against
555+
themselves: `#e1` matches with `#e1` and `#e2` matches with `#e2` since they have unique
556+
persistent names. In effect, this allows view transition to animate the visual change
557+
in several elements with a simple rule.
558+
</div>
559+
560+
540561
: <dfn><<custom-ident>></dfn>
541562
:: The [=/element=] participates independently in a view transition--
542563
as either an old or new [=/element=]--
543564
with the specified [=view transition name=].
544565

545566
Each [=view transition name=] is a [=tree-scoped name=].
546567

547-
The values <css>none</css>, <css>auto</css>, and <css>match-element</css> are excluded from <<custom-ident>> here.
568+
The values <css>none</css>, and <css>auto</css>, excluded from <<custom-ident>> here.
548569

549570
Note: If this name is not unique
550571
(i.e. if two elements simultaneously specify the same [=view transition name=])

0 commit comments

Comments
 (0)