Re: [csswg-drafts] [css-view-transitions-2] Ignore offscreen elements from participating in transitions (#8282)

I like the direction this conversation was going. The main thing that justifies a new attribute for this is the idea that this could be a UX choice rather than a mere optimization (e.g. preventing a header from jumping).

I think the semantics here should be similar to content-visibility and intersection observers, however because this is observable and not just an optimization, the definitions need to be exact and customizable via a margin (same as `rootMargin` in `IntersectionObserver`).

Another thing I think we should do is make this new attribute inherited, this way the author can decide that a container makes its entire set of descendants behave in a certain way (and this can be overridden further down the tree).

Perhaps this can be `view-transition-visibility` or `view-transition-overflow` with:
- `visible`: current behavior
- `auto`: similar to `content-visibility: auto`. element acts as if it doesn't have a `view-transition-name` if it's not intersecting with the viewport.
- `hidden`: element ignores its `view-transition-name`. As this attribute is inherited, this can be used to hide an entire tree from the view transitioning capture algorithm
- `clip`: the element participates in the transition, but only contents of the element that intersect with the viewport are captured.. 



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


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

Received on Monday, 23 October 2023 16:48:33 UTC