I created an animation for a button, which works well if the button is a div container. However if I apply the same CSS to an input field the animation breaks. Could someone explain why this is the case and how to resolve it?
This is how my CSS looks like:
.submit__button {
font-family: BentonSans;
font-weight: 500;
font-size: 0.9rem;
padding: 0.78125rem;
line-height: 60px;
display: flex;
border: 2px solid #303333;
margin: 2rem auto 0;
transition: 0.5s;
-webkit-transition:0.5s;
position: relative;
vertical-align: middle;
color: #303333;
display: inline-block;
text-align: center;
transition: 0.5s;
padding: 0 20px;
cursor: pointer;
-webkit-transition:0.5s;
}
.submit__button:hover {
border: 2px solid rgba(0,0,0,0);
color: #303333;
}
.submit__button::before, .submit__button::after {
width: 100%;
height:100%;
z-index: 3;
content:'';
position: absolute;
top:0;
left:0;
box-sizing: border-box;
-webkit-transform: scale(0);
transition: 0.5s;
}
.submit__button::before {
border-bottom: 2px solid #000;
border-left: 0;
-webkit-transform-origin: 0% 100%;
}
.submit__button::after {
border-top: 0;
border-right: 0;
-webkit-transform-origin: 50% 50%;
}
.submit__button:hover::after, .submit__button:hover::before {
-webkit-transform: scale(1);
}