Hi,
I am currently working on a hover effect on the buttons on my website and was wondering if it was possible to use the width of the button to determine the time in which the transition takes i.e make it so the transitions is the same speed regardless of whether the button is narrow or wide. Currently the transition looks very fast on wider buttons because the colour change has to travel further in the time. This screen recording (https://go.screenpal.com/watch/cTVjrFneBCV) highlights what I mean - the transition on the ‘add to cart’ button is a lot faster than the ‘send’ button because it’s almost twice the width.
Currently the code is:
.btn {
transition: opacity .6s ease, color .6s ease, background-position .4s ease-out
}
but I want to make it so the code calculates the time based on the width of the button. Is that possible?
Thank you in advance!
Holly