I was having some issues doing colour-based transitions...
I was working with the following CSS:
.embtn {
position:absolute;
top:0vh ;
left: 0vw;
border-radius: 5vw;
padding: 0.2vw;
color: red;
width: calc(2vw + 1vh);
height: calc(2vw + 1vh);
background-color: white;
-webkit-transition: background-color 2s ;
-webkit-transition: width 0.5s ease-out;
-o-transition: background-color 2s ;
-o-transition: width 0.5s ease-out;
-moz-transition: background-color 2s ;
-moz-transition: width 0.5s ease-out;
transition-delay: 2s;
transition: background-color 2s ;
transition-delay: 2s;
transition: width 0.5s ease-out;
transition-delay: 2s;
}
.embtn:hover {
-webkit-transition: background-color 2s ;
-webkit-transition: width 0.5s ease-out;
-o-transition: background-color 2s ;
-o-transition: width 0.5s ease-out;
-moz-transition: background-color 2s ;
-moz-transition: width 0.5s ease-out;
transition: background-color 2s ;
transition: width 0.5s ease-out;
background-color: black;
width: 30vw;
}
on the following code:
<div class='embtn'><div id="searchproduct" style="font-size:calc(1vw + 1vh);cursor:pointer; display: inline;" onClick="searchProducts()">🔍</div>
<input id="search" style=" color: white; position:absolute; top: calc(((2vw + 1vh)/2)-(1vw + 1vh); ); ; left: 3vw; display: inline; border-style: none; outline: none; background: transparent; width: 25vw; font-size: calc(1vw + 1vh); " type="text" placeholder=" Search..." name="search" required>
</div>
And was hoping to see the delayed transitions... The width transition worked fine with the intended delay but the colour transition wasn't delaying... i.e. It not only occured instantaneously but it did not wait the 2s before happening...
Any suggestions?