Re: [csswg-drafts] [css-view-transitions-2] view-transition-name determined by element (#8320)

I don't think we actually want this to be a generic feature, for a few reasons.

1. As Miriam/#8319 points out, having it be *just* the randomly-generated identifier isn't actually very useful, and you instead want to be able to group them in some targetable way *while* giving them unique identities. That's something fairly specific to view-transitions.
2. As @dbaron points out [over in the Toggle repo](https://github.com/tabatkins/css-toggle/issues/46#issuecomment-1343064036), having computed styles be unique per element defeats some style-sharing optimizations that are pretty nice to keep. In the toggle case, the common case we need to care about is referencing the sibling index of the element, which we can defer resolving until used-value time; I think this would fall into the same bucket, where all you need at computed-value time is the idea that the names *are* unique in some way, but they don't actually need to *become unique* until used-value time.

So I instead recommend having view-transitions define a custom way of saying "this thing has a name, but *also* is unique based on element identity in a way that's not exposed directly but does affect before/after matching". Maybe just `view-transition-name: foo unique;` or `foo per-element`?

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


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

Received on Thursday, 19 January 2023 20:46:53 UTC