You have a button and a menu. The menu opens on click. You want it pinned to the button's right edge, and you want it to flip to the other side when the button drifts too close to the viewport. For years that was JavaScript. Read the button's bounding rect on every scroll. Hand pixel offsets to position: absolute. Rewrite the whole thing the first time a parent turns into a scroll container.
Two CSS properties now do the wiring. anchor-name on the thing you're pinning to, position-anchor on the thing you're pinning. Everything else is a value system layered on top.
What actually got wired up
anchor-name takes a dashed-ident. Same shape as a custom property: it starts with two dashes, but it lives in its own namespace.
.anchor {






