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

Noticed this wasn’t on the agenda for the F2F, but if there’s time maybe we can discuss?

I think it’s clear what we want auto naming for both simple and complex cases.

- Simple cases would use `auto` as a value for the `view-transition-name`.
- More complex cases _(e.g. more complicated DOM structure, MPA, transition between two different elements)_ would rely on `ident()` _(from #9141)_ to generate a predictable unique ident. This can be combined with `attr()` to get an attribute value, other things like `sibling-index()`, or even other idents and string values.

The result for authors is that there’s less code and less naming things going on – see [this example](https://codepen.io/bramus/pen/PogVZwb) that uses a polyfill to get the syntax working. Some names are auto-generated, whereas some rely on `ident()`. The delta with [the current approach](https://codepen.io/bramus/pen/xxmozvN) is 100 LOC removed.

The thing that’s unclear is how `auto` should work. Trying to interpret [the previous discussion](#issuecomment-2113040820) it was suggested to try a waterfall of values, starting with the `id` attribute (which should already be unique), before falling back to an auto-generated value. By the looks of it we were pretty close on this, and maybe can come to a conclusion – even if “auto with details TBD” – now?

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


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

Received on Wednesday, 12 June 2024 21:14:23 UTC