Re: [csswg-drafts] [css-view-transitions-2] Creating 'classes' of transition groups (#8319)

> The point being that I would like to be able to a CSS selector directly, rather than being forced to deal with the indirection of setting a CSS property with a selector and then referencing views for those elements by a "name".
> 

I like the simplicity! but wondering how it would work in practice given more complex selectors, think `section.box:has(.item:not(:active))` etc. Points to consider:
- The selectors that match the `view-transition-name` are resolved at two points in time (capturing the old state, capturing the new state).
- The first point in time can even be in a different document from the one where the pseudo-element styles are defined... 

So to make this work we'd have to do one of the following:
1. Constrain this to a limited set of selectors (eg classes/ids). This feels too limited in the CSS world and some results would be unexpected. (sometimes you think you defined a matching pseudo but it wouldn't work because of this constraint).
2. Snapshot all the possible selectors that could possibly qualify a particular element in the old state, and then match them when matching the pseudo-elements. Not sure this is feasible in a consistent way.
3. Only match the pseudo-elements if they were also available in the style when capturing the old state. Not sure if this is an acceptable side effect.

Note that none of these options support assigning such class using an inline style on the old/new element but perhaps that's OK in itself. 

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


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

Received on Sunday, 10 December 2023 21:33:21 UTC