View Transitions: shadowRoots option in startViewTransition()
- Category
- CSS
- Type
- New or changed feature
- Status
- Proposed (Chrome Proposed)
- Intent stage
- None
Summary
Adds a `shadowRoots` sequence to `StartViewTransitionOptions` (defaulting to `[]`). This allows `document.startViewTransition()` and `element.startViewTransition()` to discover participating elements (`view-transition-name`, `view-transition-class`, and `view-transition-group`) inside specified descendant `ShadowRoot`s while preserving shadow DOM encapsulation.
Motivation
View transition names are tree-scoped, so transitions started on a document or element cannot discover `view-transition-name` declarations inside shadow trees. Authors currently have to work around this using `::part()` or moving styling out of the shadow tree, which breaks encapsulation or prevents animating shadow internals alongside slotted light DOM content.
Standards & signals
- Specification: https://drafts.csswg.org/css-view-transitions-2/#dom-startviewtransitionoptions-shadowroots
- Firefox: No signal
- Safari: No signal
- Web developers: No signals
- Tracking bug: https://issues.chromium.org/issues/584738355
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=view-transitions-shadowroots-option-in-startviewtransition
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+View%20Transitions%3A%20shadowRoots%20option%20in%20startViewTransition()
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=View%20Transitions%3A%20shadowRoots%20option%20in%20startViewTransition()
- Baseline status: https://webstatus.dev/?q=View%20Transitions%3A%20shadowRoots%20option%20in%20startViewTransition()
Explainers: https://github.com/w3c/csswg-drafts/issues/12953