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

> Can you elaborate on the reasons?

It's mostly this use-case: "I have a list of cards in a container and only one of them needs to be parented to that container". Adding `view-transition-parent` to that one card would be the least lines of code to accomplish it. The other way, `view-transition-tree` on the parent + a `view-transition-parent: none` on all other children is more code and I don't see why that's better.

> It is also somewhat strange to me that this element would only nest the referenced element, and not the rest of its descendants (unless also explicitly named).

The author can get this behaviour by using `view-transition-tree` though. I just think that the use-case of only child being nested under a parent is also a valid use-case and we don't have to choose a syntax which makes it unnecessarily verbose.

>  Are there any other CSS concepts that align closer to this? For some reason I'm thinking of anchor positioning, but even there, I don't think there's this type of effect

Good question. Anchor positioning does require a `anchor-name` declaration for another element to be able to anchor to it. But I suspect its because you need a way to identify that element in CSS and add constraints to it to be able to be an anchor. We're already getting all of that by the fact that the parent needs to have a `view-transition-name`. So we don't need to also add `view-transition-tree`? @tabatkins to validate my thinking.

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


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

Received on Tuesday, 21 May 2024 15:41:23 UTC