Active view transition
The :active-view-transition CSS pseudo-class matches the root element when a view transition is active. The :active-view-transition-type() CSS pseudo-class matches only when the active view transition was started with the specified type.
Overview
The :active-view-transition CSS pseudo-class matches the root element when a view transition is active. The :active-view-transition-type() CSS pseudo-class matches only when the active view transition was started with the specified type.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 125 | 125 | 144 | 18 | 125 | 18 | |
| DOM API | ||||||
| The types read-only property of the ViewTransition interface is a ViewTransitionTypeSet that allows the types set on the view transition to be accessed and modified. | 125 | 125 | 147 | 18.2 | 125 | 18.2 |
| The ViewTransitionTypeSet interface of the View Transition API is a set-like object representing the types of an active view transition. This enables the types to be queried or modified on-the-fly during a transition. | 125 | 125 | 147 | 18.2 | 125 | 18.2 |
@@iterator [Symbol.iterator] | 125 | 125 | 147 | 18.2 | 125 | 18.2 |
add | 125 | 125 | 147 | 18.2 | 125 | 18.2 |
clear | 125 | 125 | 147 | 18.2 | 125 | 18.2 |
delete | 125 | 125 | 147 | 18.2 | 125 | 18.2 |
entries | 125 | 125 | 147 | 18.2 | 125 | 18.2 |
forEach | 125 | 125 | 147 | 18.2 | 125 | 18.2 |
has | 125 | 125 | 147 | 18.2 | 125 | 18.2 |
keys | 125 | 125 | 147 | 18.2 | 125 | 18.2 |
size | 125 | 125 | 147 | 18.2 | 125 | 18.2 |
values | 125 | 125 | 147 | 18.2 | 125 | 18.2 |
| Other | ||||||
| `:active-view-transition-type()` | 125 | 125 | 147 | 18.2 | 125 | 18.2 |
Syntax
:root:active-view-transition {
background: #f0f0f0;
}
:root:active-view-transition-type(slide) {
--transition-duration: 300ms;
} Live demo
Use cases
Using Active view transition
The :active-view-transition CSS pseudo-class matches the root element when a view transition is active. The :active-view-transition-type() CSS pseudo-class matches only when the active view transition was started with the specified type.
Cautions
- May not be supported in older browsers.
Accessibility
- Make sure visual changes are conveyed appropriately to assistive technology.
Related links
Powered by web-features