CSS does your tooltip positioning now
If you’ve ever built a tooltip, a footnote, or a popover then you’ve written some version of this: const rect = trigger.getBoundingClientRect(); tooltip.style.top = `${rect.bottom + 8}px`; tooltip.style.left = `${rect.left}px`; Looks fine, until the window resizes. Or the page scrolls. Or the tooltip lands near the bottom of the viewport...