[csswg-drafts] [css-anchor-1] Ability to escape containment of other positioned elements (#8588)

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

== [css-anchor-1] Ability to escape containment of other positioned elements ==
<details>
<summary>Disclaimer and additional links</summary>

I'm submitting my feedback following my experiments with the current implementation of anchor positioning in Chrome Canary.

I wrote an article about my experiments, but decided to fill most of my feedback as separate issues here.

A quick summary of related links:

- [anchor positioning specs](https://drafts.csswg.org/css-anchor-position-1/)
- [my article with the experiments](https://kizu.dev/anchor-positioning-experiments/)
</details>

On one side, I found an ability to wrap some stuff into an element with `position: relative` and this isolate all the anchors inside to be a useful one, on the other — I found this to be very limiting.

I'm not sure if something like that is planned/already considered in the specs, but what I would love is to be able to _change_ that positioned context separately from the `anchor-name`. Maybe using a `container-name` or something similar?

Basically, I would want to be able to tell an element “regardless of where you're placed in the tree, I want you to emerge upward up to a certain container, and only then look up for your anchor-names.” This would allow using global popovers, without a fear of them being constrained by some random `position: relative` that a parent could get.

This is very similar to the `position: sticky` problem, which often is limited by its context, or even `position: fixed` that often can get blocked by its stacking context having something like a `transform` applied. So it would be really nice for an absolutely positioned element to be able to “escape” its stacking/positioning context.

When I was initially thinking of anchor positioning, this was one of the first things I always wanted to be able to do in CSS — ability to skip some of the parents with `position: relative` or choose one of the parents explicitly as the context for my element, rather than relying on the implicitly defined contexts.


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


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

Received on Wednesday, 15 March 2023 12:34:01 UTC