Re: [csswg-drafts] [css-anchor-position-1] Allow anchor references to match names in outer tree scopes (#9408)

What about new functions?

```css
.positioned-notice {
    position-anchor: crossrootnearest(--anchor-el);
}
.positioned-notice2 {
    top: anchor(crossrootupward(--anchor-el));
}
```

where here `crossrootnearest` finds the nearest matching anchor in this order:

- check the current root
- if not found, check all roots below the current root in tree order
- if not found, check the next root upward
- if not found, check all roots downward except the one we just went upward from
- if not found, repeat the previous step until found, or until there are no more upward roots

and where here `crossrootupward` finds the nearest matching anchor in this order:

- check the current root
- if not found, check the next root upward
- if not found, repeat the previous step until found, or until there are no more upward roots


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


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

Received on Monday, 13 May 2024 17:22:42 UTC