Re: [csswg-drafts] [css-view-transitions-2] Proposal for a view-transition-tree property (name tbd) (#10334)

> One approach would be to make view-transition-parent an inherited property

We don't need it to be an inherited property for this. A simple descendant selector will do it, though it reads kinda awkward.

```css
.container {
  view-transition-name: container;

  /* Parent all named children to me. */
  view-transition-tree: preserve;
}

.container * {
  /* Actually, don't. */
  view-transition-parent: none;
}
```

> I think whether or not view-transition-parent should be inherited is a worthwhile topic on its own

That's true! I'm not sure about this: "since if an element wants to have a different parent, presumably all its children by default also want to have that parent?". I expect the common case would be for that element's children to be parented to it. Something like:

```
.container {
  /* Parent me to foo */
  view-transition-parent: foo;

  /* Parent all named children to me */
  view-transition-tree: preserve;
}
```

In fact since the proposal above is for `view-transition-parent` to have preference over `view-transition-tree`, in the above example inheriting `view-transition-parent` would mean the author has to remove it.

-- 
GitHub Notification of comment by khushalsagar
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10334#issuecomment-2125293218 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 22 May 2024 16:48:56 UTC