[csswg-drafts] [css-anchor-position] Alignment shouldn't interfere with sizing (#10315)

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

== [css-anchor-position] Alignment shouldn't interfere with sizing ==
The current definition of `anchor-center` says

> Additionally, any auto inset properties resolve to 0. However, the available space for the positioned element in the relevant axis is reduced to the size of the largest rectangle that is centered on the default anchor element and doesn’t overflow the inset-modified containing block. (Possibly being zero-sized, if the anchor’s center is not within the inset-modified containing block.)

In general, alignment doesn't change the containing block for sizing, it just shifts the box within the alignment container. (The only exception is stretch, which simply fills the box.) In all cases, there are only two sizes to consider, and their relationship to each other: the alignment container, and the alignment subject. I don't think we should change that here.

Also this behavior yields some really weird, and likely unexpected, results for simple things like

```
inset-area: bottom;
max-width: 20em;
```

where if the anchor happens to be near the edge of the screen, the tooltip ends up wrapped into a very very narrow tall block.

If the author wants to cap the size to the largest width that could result in true centering, let's add that as a keyword to the sizing or inset properties or something else that's actually supposed to affect sizing.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10315 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 01:16:38 UTC