Closed bfgeek closed 2 years ago
The CSS Working Group just discussed Anchor Positioning
.
Honestly, I feel like the current API is too complex. The "basic" use case requires dozens of lines of code, I'm not sure this makes sense.
You have to do lots of math to do basic behaviors like anchoring always to the bottom right of the anchor without fallback.
I am not sure also how this API handles multiple popups that should not overlap each other. But maybe that should be a separate issue?
For instance, the demo with the bar chart, if two bars have the same height, wouldn't the labels draw on top of each other?
The CSS Working Group just discussed CSS Anchor Positioning
, and agreed to the following:
RESOLVED: ED of Anchor Positioning, editor TabAtkins iank_ jhey
@FremyCompany please raise new issues for questions; I've added a label for the spec now.
You have to do lots of math to do basic behaviors like anchoring always to the bottom right of the anchor without fallback.
?? It's top: anchor(--foo bottom); left: anchor(--foo right);
. Fallback requires more work, but the basic behavior is as simple as it can possibly be.
I am not sure also how this API handles multiple popups that should not overlap each other. But maybe that should be a separate issue?
Yes, separate issue.
For the first issue, I was thinking of cases where you want some breathing room between the popup and the position. You cannot use margin, because if the popup ends up moved, the margin will apply in the wrong direction. So you have to use calc()
to apply the margins.
But yes, I will open new issues ;-)
This is a placeholder issue to introduce CSS Anchor Positioning to the CSSWG.
Explainer: https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/CSSAnchoredPositioning/explainer.md See - https://tabatkins.github.io/specs/css-anchor-position/ for a rough overview of the current thinking.