0:000:26
Post by jhey ʕ•ᴥ•ʔ
CSS Tip! 🤙 You can create this magnetic :hover effect with CSS anchor positioning, :has, and zero JS 🔥 article { anchor-name: --develop; } ul:has(li:hover) { --anchor: --develop; } ul::after { inset: anchor(var(--anchor) top) anchor(var(--anchor) right)
Why it is here
A magnetic hover highlight built with anchor positioning and :has(), no JavaScript involved.
- Likes
- 4,7954.8K
- Replies
- 43
- All-time rank
- #7
- Week
- W442023
Went viral
Posted on X