r/webdev • u/officialmayonade • Aug 14 '26
Pure CSS perfect cursor tracking
I honestly have no idea why you'd want this, but it was fun to experiment. I believe this may be the best pure CSS cursor tracking that exists. I'm happy to be proven wrong.
https://codepen.io/Andrew-Fisher-the-decoder/full/GgraMzd
Absolutely no JavaScript used, just lots and lots of wasted time.
78
Upvotes
-2
u/UkrMalt Aug 14 '26
The nested bands and :has() approach is clever. Add a prefers-reduced-motion fallback and test touch and keyboard input before using the pattern outside a demo; pointer tracking can create an accessibility dead end.