Re: [csswg-drafts] [css-anchor-position] Allow multiple names in position-anchor, for fallback (#12576)

Thanks for opening this @tabatkins! Here's  [the pen](https://codepen.io/una/pen/vENmVbX/938fa7e58871a73e50687af9dea1dd5a) that describes the issue. The CSS specificity of the selector which updates `anchor-name` on `:hover/:focus` is higher than the specificity of the `anchor-name` set on `.selected`. It updates as-expected when the DOM order of the `.selected` item is *before* the `:hover/:focus` item, but not when it comes after.

For example, this works as expected when the first item is the `.selected` one. However, when the 3rd item is `.selected`, the styles will apply to the 4th and 5th item, but not the 1st and 2nd.

While this works as specced, from an authoring perspective it feels unexpected. 

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


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

Received on Tuesday, 5 August 2025 18:27:19 UTC