Loading video...

Video Failed to Load

Go Home

Directional aware CSS button :hover w/ lh, text-shadow, and linear() button:has(span:nth-of-type(2):hover) { --y: -1lh; } button span:first-of-type { translate: 0 var(--y); transition: translate .875s var(--spring); text-shadow: 0 1lh currentColor, 0 -1lh currentColor; }

40,229 views • 1 year ago •via X (Twitter)

9 Comments

Ahmed ALABSI ❁'s profile picture
Ahmed ALABSI ❁1 year ago

You can generate custom easing functions for css using this tool PSA: the website is not mobile friendly

jhey ▲🐻🎈's profile picture
jhey ▲🐻🎈1 year ago

Made my own for CSS conversion 🤙

Charlie Joseph's profile picture
Charlie Joseph1 year ago

I didn’t realise native CSS had spring animations now! I always thought it was a JS thing

Pablo Stanley's profile picture
Pablo Stanley1 year ago

such a little but awesome detail 😊

Arman Kazi's profile picture
Arman Kazi1 year ago

Can you make this transition from one direction every time you hover it ?and not reversing when u hover the second time

Cypher's profile picture
Cypher1 year ago

So pretty

Enicma's profile picture
Enicma1 year ago

Nice trick! What about mobile devices?

Sa-Senpai's profile picture
Sa-Senpai1 year ago

aha ! how come I didn't think of this before !

EIO's profile picture
EIO1 year ago

Brilliant! 😅

Related Videos