Re: [csswg-drafts] [css-anchor-1][css-position] Add the “centering” behavior which is now defined as an example in the specs as something built-in (#8979)

> This actually seems to be the most feasible idea to me.

Agree about the feasibility — and it could be a good start in absence of other ways to achieve this, even with the `margin-inline` fallback (or using multiple elements).

* * *

Started reading the working draft from scratch, and [the first example](https://www.w3.org/TR/2023/WD-css-anchor-position-1-20230629/#example-789aaa6b) really falls apart when it comes to centering. First all is good: we have a few declarations with very simple values, but then, suddenly, we get a block of declarations with calculations and a hard-coded values:

```CSS
  left: clamp(0px, anchor(center) - 150px, 100% - 300px);
  right: clamp(0px, anchor(center) - 150px, 100% - 300px);
  max-width: 300px;
```

With this being the first example (and the tooltips/popovers centered around their anchors being one of the most prominent use cases for anchor positioning overall), it would be really nice to somehow address this in the specs. cc @tabatkins 

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


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

Received on Tuesday, 4 July 2023 14:55:46 UTC