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

> I wonder if attr() is usable here? I think if attr() is supported, it would probably address most use cases.

+1 to using `attr()`.

Also +1 to Jen's usecase and proposal ( https://github.com/w3c/csswg-drafts/issues/8320#issuecomment-2023077559 ) for `auto`.

> See discussion above - the problem with this solution is that it doesn't work for cross-document, or if the framework recreates the element. Generating the name from attributes is perhaps more verbose but works for all those use-cases.

An `auto` keyword wouldn't address those use cases, but it would address the ones that Jen is trying to solve, which don't have this problem. If you're rebuilding the DOM, then yes, you will need to do something else. But if you're not -- and there are many interesting cases where where you're not -- we can make this a lot simpler for the author.

We could go further to address cross-document cases by relaxing the restriction that a name must be unique and come up with a matching algorithm that can handle multiple elements.

To address things that move or disappear, authors can use unique tags for those items. So let's say you have a list of 10 items and you're moving item 8 to be the 2nd item. You identify that item with a unique name, and the rest of the items with a generic one, and the UA matches them up in DOM order.

We might want to be able to scope the count within a subtree somehow, but I think this would work without requiring counting code in the HTML generator or in JS, and that seems like a usability win imho, particularly for lightweight websites.

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


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

Received on Wednesday, 17 April 2024 03:50:55 UTC