Copied a hover effect but is not the same as the original
original: https://fossheim.io/ button label: collaborate
Playground: https://play.tailwindcss.com/ye0B1eQNlY
1 Reply
Box shadows and positions (top, left etc.) are not very good for animations.
I suggest that, rather than changing the top and left position on hover, try using translate:
translate: 5.5px 6px;
(don't forget to add translate to the transition)
Actually I think that you have copied something differently.
I have just copied the original CSS and in my version it is working in the same way as the original.
This is my based on the original CSS(removed the custom properties etc.) :
That said, I would be tempted to use pseudo elements and translate rather than adjusting the position and box-shadow. Something like this: