Re: [csswg-drafts] [css-anchor-position] Let more pseudo-elements have implicit anchor elements (#11792)

Hello,

I'd like some clarification on this. From what I understand from the spec "The position-anchor property is supported on all elements that are positioned, including pseudo-elements like ::before and ::after. Pseudo elements are implicitly anchored to the same element as the pseudo-element's originating element, unless otherwise specified."

However, this is not what I am experiencing currently (I suppose that Safari 26+ and Chrome latest are already implementing this) so I wonder if the spec is incorrect here, or if I am hitting into an undocumented situation.

To reproduce the issue, you can open this store: https://stretch-theme-sand.myshopify.com/

What I am trying to do is having an overlay that appears just below the mega-menu:

<img width="1710" height="953" alt="Image" src="https://github.com/user-attachments/assets/b2170ee1-c518-407d-8885-bd5ebba2f761" />

By positioning the ::after pseudo-element with top: anchor(end) I expected the overlay to be positoned at the bottom of the parent (so the mega-menu). However, it is positioned at the top, not at the end:

<img width="1710" height="811" alt="Image" src="https://github.com/user-attachments/assets/74f38106-3141-4297-a42e-859405d03700" />

If I manually create an anchor on the mega menu using anchor-name: --mega-menu and use the same positioning using an explicit anchor, I get the expected result:

<img width="1710" height="795" alt="Image" src="https://github.com/user-attachments/assets/d4d853ad-0946-4be6-82c7-5d1967c42dc5" />

But this sounds strange, as the mega-menu _is_ the parent of the pseudo-element, so it should behave like this without needing an explicit anchor.

Am I getting the spec wrong here? If that's the case I think something should be clarified as, as I understand it, the two should behave the same.

Thanks.

-- 
GitHub Notification of comment by bakura10
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11792#issuecomment-4159353619 using your GitHub account


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

Received on Tuesday, 31 March 2026 02:11:56 UTC