Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The ::view-transition-new
CSS pseudo-element represents the "new" view state of a view transition — a live representation of the new view, after the transition.
During a view transition, ::view-transition-new
is included in the associated pseudo-element tree as explained in The view transition process. It is only ever a child of a ::view-transition-image-pair
, and never has any children.
It is a replaced element, and therefore can be manipulated with properties such as object-fit
and object-position
. It has natural dimensions equal to the content's size.
The following default styling is included in the UA stylesheet:
css
@keyframes -ua-view-transition-fade-in {
from {
opacity: 0;
}
}
html::view-transition-new(*) {
position: absolute;
inset-block-start: 0;
inline-size: 100%;
block-size: auto;
animation-name: -ua-view-transition-fade-in;
animation-duration: inherit;
animation-fill-mode: inherit;
}
Note: Additional view transition style sheet styles are also setup to animate ::view-transition-new
. These are dynamically generated during the view transition; see the specification setup transition pseudo-elements and update pseudo-element styles sections for more details.