[csswg-drafts] [css-contain] Can we allow absolutely positioned elements to escape a container? (#10102)

mirisuzanne has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-contain] Can we allow absolutely positioned elements to escape a container? ==
I'm splitting this out from #10040, where [we resolved](https://github.com/w3c/csswg-drafts/issues/10040#issuecomment-2009840674) that `anchor-name` is able to escape containment. That helps authors position elements in relation to contained anchors. But it doesn't help with the inverse: absolutely positioned elements inside a container cannot be anchored to anything outside the container.

This mirrors a common footgun with container queries. The container (`layout` containment) generates a fixed positioning context, so position-fixed elements are fixed to the container rather than the viewport.

If there is any way to loosen that requirement for container queries, it would remove the footgun and also allow more fluid interaction between container queries and anchor positioning. 

I'm not entirely clear why this fixed-positioning context restriction is useful for container query implementations. I would have expected the (already resolved) counter example to be more problematic - since generally we don't want external layouts relying on container internals. In this case we only want internal layout to rely on external context - which is already the case. But maybe my mental model is wrong here?

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10102 using your GitHub account


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

Received on Wednesday, 20 March 2024 15:49:00 UTC