Chris Coyier builds a no-JS kebab menu using HTML popover invokers, anchor-name and position-anchor, and CSS anchor positioning with smooth open and close animation. And a smart positioning via the position-try property, so the menu always stays in view.
frontendmasters.com/blog/popover-context-menus-with-anchor-positioning