CKTIS / CSS
::view-transition-group-children() — nested group container
A view-transition pseudo-element containing nested groups. It lets you clip their contents during animation without clipping the parent group's image pair.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
::view-transition-group-children( [ [ <custom-ident> | '*' ]? <pt-class-selector>* ]! )
<pt-class-selector> = '.' <custom-ident>::view-transition-group-children() contains descendant ::view-transition-group() pseudo-elements. It is generated when required by view-transition-group; it is not an ordinary DOM element.
A name such as panel refers to the parent group, not a nested group. * on its own selects all such containers. The name can be omitted: ::view-transition-group-children(.tile) selects containers whose parent group has the tile class set through view-transition-class. The container is a sibling of ::view-transition-image-pair(panel) inside ::view-transition-group(panel); its default size matches the group.
In the example, view-transition-group: panel nests the tile group, and overflow: clip on the container clips it during movement. The selector alone creates neither a transition nor nesting.
This is a CSS View Transitions Level 2 draft feature. Verify it in the target browser; the Chromium 152 scope gate does not establish example correctness.
Examples
<!doctype html>
<meta charset="utf-8">
<title>Nested transition clipping</title>
<style>
#panel {
width: 200px;
height: 100px;
overflow: clip;
background: #ddd;
view-transition-name: panel;
}
#tile {
width: 80px;
height: 80px;
background: #075;
view-transition-name: tile;
view-transition-group: panel;
}
#panel.moved #tile { transform: translateX(160px); }
::view-transition-group-children(panel) { overflow: clip; }
::view-transition-group(*) { animation-duration: 2s; }
@media (prefers-reduced-motion: reduce) {
::view-transition-group(*) { animation-duration: 0s; }
}
</style>
<button id="move" type="button">Move</button>
<div id="panel"><div id="tile"></div></div>
<script>
const panel = document.querySelector('#panel');
const move = document.querySelector('#move');
move.addEventListener('click', async () => {
const update = () => panel.classList.toggle('moved');
if (!document.startViewTransition) {
update();
return;
}
move.disabled = true;
try {
await document.startViewTransition(update).finished;
} finally {
move.disabled = false;
}
});
</script>Result
Before clicking: an 80 × 80 green tile inside a 200 × 100 gray panel. After one click: only the leftmost 40 × 80 portion of the translated tile remains visible at the panel's right edge. With nested view transitions supported, the moving tile stays clipped during the transition.
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.