Re: [csswg-drafts] [css-anchor-position-1] Better reusability of anchor names (#9045)

> The anchor name is currently defined to be a tree scoped reference (i. e. unique for the entire document). This makes it difficult to reuse.

While it's a tree-scoped reference, it doesn't have to be unique for the document. It's scoped to the containing block of the anchor-positioned element.

That being said, this scope is still the entire tree scope for popovers, so I can see there's still some difficulty here.

> Interestingly, this does not work if we add the position: relative to the element that has anchor-name itself: https://jsfiddle.net/3fpukxan/1/ 

This is expected. We can't use the anchor name on the containing block itself.

Btw, if you want it anchored to the containing block, isn't it just the good old positioned layout (without `anchor()`)?

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


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

Received on Thursday, 20 July 2023 16:23:18 UTC