Skip to content

CSS Anchor Positioning: Allow shadow trees elements to reference anchor names defined in “higher” trees. #1351

Open

Description

@jackholden

Description

Description

Interop 2026 already covers CSS Anchor Positioning.

For Interop 2027, this is quite a specific ask but it would be great to have the ability for shadow elements to reference anchor names defined in higher trees implemented across all browser engines reducing the need for ::part().

Currently no browsers ship this behaviour despite it being part of the specification. It would drastically reduce some of the current friction.

CSS Anchor Positioning §2.1:

Note: Positioned elements in shadow trees can reference anchor names defined in “higher” trees. Currently, they cannot reference anchor names defined in “lower” shadow trees, though.

  <style>
    #host {
      anchor-name: --higher-anchor;
      background: lightgray;
      block-size: 100px;
      inline-size: 200px;
      margin: 50px;
    }
  </style>

  <div id="host">
    <template shadowrootmode="open">
      <style>
        #anchored {
          background: green;
          block-size: 50px;
          inline-size: 50px;
          inset-block-start: anchor(--higher-anchor start, 37px);
          inset-inline-start: anchor(--higher-anchor end, 37px);
          position: absolute;
        }
      </style>
      <div id="anchored"></div>
    </template>
  </div>

Specification

W3C

web-feature

No response

Test Links

https://wpt.fyi/results/css/css-anchor-position/anchor-name-shadow-higher-tree.html?label=experimental&label=master&aligned

Additional Signals

Spec:

Activity

  1. github-actions commented on Sep 3, 2026

    @github-actions

    This comment was automatically generated based on the information you provided. Please don't edit it.

    No web features (from the web-features project) were found in your proposal. If your proposal doesn't correspond to a web feature, that is fine.
    Otherwise, please update your initial comment to include web-features: <feature-id>.
    To find feature IDs, use the web-features explorer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    focus-area-proposal

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions