property
View transition group — CSS reference
Level 2 group containment can organize snapshot groups into a nested hierarchy rather than a flat list. This fixture checks the declaration only; it does not prove nested clipping or capture geometry.
Formal Syntax & Structure
css syntaxcss
view-transition-group: contain;Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>view-transition-group</title><style>body{margin:12px;font:16px system-ui}#card{width:120px;padding:12px;background:#e2e8f0;color:#172033;view-transition-name:card}#card.changed{width:220px;background:#bfdbfe}::view-transition-group(*){animation-duration:.5s}@media(prefers-reduced-motion:reduce){::view-transition-group(*),::view-transition-old(*),::view-transition-new(*){animation-duration:0s!important}}#card{view-transition-group:contain}</style><body><button id="run" type="button">Change card</button><p id="card">Old state</p><output id="status" aria-live="polite"></output><script>const card=document.getElementById('card');const root=document.documentElement;const feedback=document.getElementById('status');function update(){card.classList.toggle('changed');card.textContent=card.classList.contains('changed')?'New state':'Old state';}function start(types){if(!document.startViewTransition||matchMedia('(prefers-reduced-motion: reduce)').matches){update();return null;}return types?document.startViewTransition({update,types}):document.startViewTransition(update);}async function inspect(check,types){const t=start(types);if(!t)return false;try{await t.ready;return await check(t);}finally{t.skipTransition();await t.finished;}}const ps=(name,prop)=>getComputedStyle(root,name).getPropertyValue(prop);run.onclick=async()=>{const t=start();if(t){try{await t.finished;}catch(e){feedback.textContent='Update failed';return;}}feedback.textContent='Updated';};</script></body></html>