[csswg-drafts] [css-anchor-position] Make anchor-center work without position-anchor (#10366)

yisibl has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-anchor-position] Make anchor-center work without position-anchor ==
1. Open
```html
data:text/html;charset=UTF-8, <style>
.anchor { anchor-name: --foo; width: 100px; height: 50px; display: block; margin: 30px auto;} 
.anchored{position: absolute; left: anchor(--foo 50%); top: anchor(--foo bottom); 
justify-self: anchor-center; background: green; padding: .5em 2em;}</style>
<button class="anchor">anchor</button>
<div class="anchored">anchored</div>
```

2. The green element is not horizontally centered with respect to the button.

We must add `position-anchor: --foo` for `anchor-center` to take effect. This is often confusing to the user because `<anchor-element>` is already defined on the `left`.

Can we change the status quo?

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10366 using your GitHub account


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

Received on Friday, 24 May 2024 09:08:36 UTC