system.cssthe engine GitHub

Anchored popover

Anchored popover (combobox / menu)

Use CSS anchor positioning instead of JS measurement: anchor-name on the field; on a popover="manual" element set position-anchor, top: anchor(bottom), width: anchor-size(width), and position-try-fallbacks: flip-block so it opens downward and flips up near the viewport bottom. It lives in the top layer (no z-index juggling). Chromium 125+; add an @supports fallback if Firefox/Safari matter.

Two scars to carry (gf-79, gf-46): a CLOSED .menu popover must get display: none — hiding by opacity alone leaves every hidden menu in the tab order. And out-of-flow anchor positioning LOSES to morphs: the moment the server removes or replaces the anchor node, everything anchored to it jumps or orphans. Anchor to stable, server-owned nodes only; anything that chains or stacks (toasts) stays IN-FLOW with interpolate-size collapse — degrade is a snap, never a break. An overlay that traces an element pins to THE TRACED ELEMENT itself, never its wrapper (hold-confirm's inset:0 mis-scale).