[csswg-drafts] [css-anchor-position] The containing block should be allowed as an acceptable anchor element (#10412)

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

== [css-anchor-position] The containing block should be allowed as an acceptable anchor element ==
The current [acceptable anchor element criteria](https://drafts.csswg.org/css-anchor-position-1/#acceptable-anchor-element) state that “el is a descendant of query el’s containing block”.

This makes it impossible to use anchor positioning to attach the element to its own containing block.

Are there any technical/logical limitations that prevent us from allowing doing this?

I myself struggled sometimes with this, and I saw others stumble upon this limitation as well (for example, https://www.youtube.com/watch?v=I9sqFfqIutY, I don't have a precise timestamp in mind, will update later).

While it is usually possible to use the regular absolute positioning for this like with `inset: 0` etc, it is not as powerful as anchor positioning itself, as we can't then use everything that it provides, like `inset-area`, fallbacks, etc.

In order to do something about this, authors will be required to add an extra wrapper, or stretch a pseudo-element to use instead of the containing block, both of the options being awkward and hacky.


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


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

Received on Sunday, 9 June 2024 15:29:43 UTC