Skip to content

[css-anchor-1] Transitioning when the anchor element with a given name changes #8181

@tabatkins

Description

@tabatkins

It's pretty obvious that if an element changes from top: anchor(--foo top); to top: anchor(--foo bottom), that's a computed-value change that will trigger a transition on 'top'.

But what happens when the value is top: anchor(--foo top); the whole time, but you change which element has anchor-name: --foo;? @jh3y has an example of this using the popover API, where they change the popover attribute, altering which element is used as the "implicit anchor element" without actually touching the CSS. They'd like the abspos to smoothly transition to its new position.

I think this gets solved appropriately with the exact same solution as #8180 - if the tree-scoped reference is resolved as part of the computed value, then having it change underneath you counts as a computed-value change, thus triggering a transition, and the start and end values are (non-textually) distinct, referring to the old and new anchor, so you can meaningfully transition between them.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Friday Afternoon

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions