Re: [csswg-drafts] [css-anchor-1] Need ability to say "don't render" when anchor is off-screen (#7758)

> In all these cases, “hide” means that it (and all of its contents) are invisible (like ''visibility: hidden'') and do not contribute to scrollable overflow.

One thing that we will need to handle: make the `position-visibility` transition in the same way as `visibility` itself, from [Web Animations spec](https://www.w3.org/TR/web-animations/#animating-visibility):

> For the [visibility](https://www.w3.org/TR/css-display-3/#propdef-visibility) property, [visible](https://www.w3.org/TR/css-display-3/#valdef-visibility-visible) is [interpolated](https://www.w3.org/TR/css-values-4/#interpolation) as a discrete step where values of p between 0 and 1 map to visible and other values of p map to the closer endpoint; if neither value is visible then [discrete](https://www.w3.org/TR/web-animations/#discrete) animation is used.

- - -

A related note: if the `position-visibility` will not work in the same as `visibility` in a “can be overridden on a child” way, this new property could be used as a hack for “non-overridable” visibility (given the element is abspos). If this will be the case, we could want to think about introducing a new keyword to `visibility` itself that will make it possible to achieve the same effect (making it non-overridable on the children). I wrote [an article on visibility](https://kizu.dev/restoring-visibility/) at some point, and I remember encountering use cases for this behavior (but that is probably better to open as a separate issue if there is no such yet).

- - -

All of that said, would it be possible to somehow make it apply the `visibility` itself? It will make things a lot simpler from the author standpoint.


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


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

Received on Wednesday, 6 March 2024 08:12:21 UTC