Re: [csswg-drafts] [css-anchor-position] Resolution of percentages: area or track? (#10314)

I and Ian disagreed with this behavior when it was presented in the Apple proposal last summer, and continue to do so. By having values in the same axis resolve against different sizes, it is a dramatic departure from how percentages work literally everywhere else in all of CSS, and is the sort of thing that I guarantee we'll trip over in the future.

The current spec allows authors the effects you’re talking about, but it’s somewhat involved (requiring anchor() math). If we do want to make those cases simpler, we can do so with a more explicitly-targeted syntax - perhaps anchor-size(), or a third anchor function (either way, backwards-compatible, so no urgency to do it now). 

I'd personally prefer to wait and see to what extent this is needed, tho - I don't recall seeing this sort of functionality offered by JS anchoring libraries (tho I could easily have missed something, or perhaps they just count on you having the ability to measure things yourself at that point and make your own adjustments). Even if we do want to do it in level 1, tho, I feel very strongly that this needs to be a new syntax, not repurposing percentages in this novel way, and in that case it's not a breaking change anyway, just an addition.

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


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

Received on Tuesday, 14 May 2024 21:06:15 UTC