Re: [csswg-drafts] [css-shared-element-transitions-1] Renaming and brevity (#7788)

@tbondwilkinson 

> `view-name` sounds like it's the name of the view, but really it's a "part" of the overall "view" transition.

`view-part-name` may be more accurate, but longer.

> Just so I understand, why is there a need to use a new tagging system, rather than reusing one of the existing tagging systems (class, id)?

I don't think setting a class or an ID on an element means it should be a seperate part in an animated transition. That isn't what those things semantically mean. And with class especially, it would cause an explosion of layers, since it's extremely common for an element to have a class.

It's common to want to differ the animation based on:

- Viewport width
- User preference (eg prefers-reduced-motion)
- Cascade (like a class name on the root element may influence whether a descendant is a seperate part of an animation)

This is trivial with CSS (`@media`, the cascade), but really really had to do with attributes.

Besides, this is very much a 'design' feature, so it semantically fits better with CSS than DOM attributes. See also `container-name` and `scroll-timeline-name`.

> but still wondering whether with this new DOM structure being represented in pseudoelements, rather you really do need some sort of selector syntax for that. I believe this was proposed elsewhere, I forget what the response was.

Yeah, we're working on a few options here. I'll create a separate issue for that. I'm waiting on Mozilla folks to review it, because I want to be sure I'm representing their proposal correctly. That shouldn't impact this naming change though.

> Rather than `view-before` is a pseudoclass an option?

It would work, but I don't see the advantage. This would require `::view-transition(root)` to match:

- the root part
- the root part's image group
- the root part's before image
- the root part's after image

…and I don't see why you'd ever want to do that.

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


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

Received on Monday, 26 September 2022 17:45:18 UTC