Skip to content

[css-anchor-position] What does "using anchor positioning" mean? #12552

@tabatkins

Description

@tabatkins

We have at least one spot in the spec, currently, where behavior differs based on whether an element is "using anchor positioning" or not (and which isn't directly about anchors) - an element "using anchor positioning" uses the "scrolling containing block" rather than the "local containing block" when a scroll container generates its CB. We are thinking about adding more, like in #10258.

"Using anchor positioning" is currently handwaved as "has a non-none value for position-area". This is definitely a sufficient signal for the use of anchor positioning, but it's not a necessary one - an author can use anchor positioning (or at least indicate their interest in anchor positioning) in other ways:

  • set position-anchor to a non-initial value (but they might be using anchor positioning with the default value)
  • use an anchor() function in their inset properties
  • use an anchor-size() function in several of their sizing properties

Talking with @bfgeek, we think we should add at least some of these additional signals to the concept (and actually dfn the term while we're at it). Which should we add?

  1. I think a non-initial position-anchor is a gimme. Especially if we do re-add implicit as a keyword to be explicit about it (or be more specific about the implicit source, like adding popover or pseudo or something).
  2. I guess use of an anchor function in inset/sizing properties is okay, it's just.... weird. You can "use" anchor functions in ways that don't actually get "used", like variable fallback, and it's unclear how we might want that to trigger. But it's kinda weird if we have behavior designed to make anchorpos work better and it doesn't trigger when you're literally using top: anchor().

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Thursday Breakout (2:30pm?)

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions