Skip to content

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

Closed as duplicate of#11769
@kizu

Description

@kizu

The current acceptable anchor element criteria 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/live/76hIB2L_vs4?si=qTCuTm1Js52x1Ydk&t=2191).

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Thursday Afternoon

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions