What the CSS :near pseudo-class would replace in your JS
Thomas Walichiewicz proposed a :near() selector so CSS can react when a pointer gets close to an element. It would replace the usual pointermove distance math, though the CSS Working Group is still weighing the fingerprinting risk.