Re: [csswg-drafts] [css-anchor-position] Default alignment in center track. (#11803)

Mmm, I don't have a strong preference for either.

Quickly testing: https://codepen.io/kizu/pen/qEBRjzo?editors=1100 

On the left — `anchor-center`, on the right — `center`.

<img width="317" alt="A screenshot of the CodePen above. It shows a 2 by 2 grid with first row having small anchor width and the anchored element shrinking, and second row shows a wide anchor, with the anchored element being wide. In the left column the anchored element is always centered, in the right column it is offset, and in the first row it is not visually connected to the anchor." src="https://github.com/user-attachments/assets/f3a16d8e-79be-482b-a99e-76d7b3306d95" />

If the inset is larger than the width of the anchor, then I prefer `anchor-center`. With an anchor larger than the positioned element, I can see how you could want to express that shift from the side. At the same time, you could also use `margin` for this, which will be, while slightly different, the same for both cases.

If there are actual use cases where this plays a role, we can change it. Otherwise, given this is just a default that can be changed, and I don't see a big effect from the change, I'd stick with the `anchor-center` for all these cases just for consistency (but, again, no strong preference).

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


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

Received on Friday, 28 February 2025 23:52:12 UTC