Open bramus opened 3 hours ago
The alternative is that authors always set a default type using CSS (cross-document) / JS (same-document) when none is to be used, but that seems a bit counterintuitive:
@view-transition {
navigation: auto;
types: default;
}
const t = document.startViewTransition({
update: () => {
document.documentElement.classList.toggle('vt');
},
types: ['default'],
});
Right now we have the following selectors to customize the view transition styles in certain cases:
:active-view-transition
applies when there is an active view transition (regardless of it having types or not).:active-view-transition-type(<custom-ident>#)
matches when there is an active view transition with the given type(s).What is missing here is way to target the v-t root when a view-transition using any type is happening. This be useful to provide some default view-transition styles (e.g. when going from page to page) but special case the types.
Suggestion is to allow
*
in:active-view-transition-type()
which would match any type, or to add the functionless:active-view-transition-type
pseudo-class selector.