I need help in preventing the scale animation of the :before part of the icon class from occurring when the button is hovered. The current behavior is causing the arrow to look distorted on hover...
HTML
<div class="section">
<div class="button"><href="#">Button<span class="arrow-right icon"></span> </div></div>
CSS
.section {
padding: 40px 0;
}
.button {
position: relative;
padding-top: 14px;
padding-bottom: 14px;
padding-left: 25px;
padding-right: 85px;
border: 2px #009EE2 solid;
float: left;
color: #FFFFFF;
background-color: #009EE2;
cursor: pointer;
font-size: .9em;
text-transform: uppercase;
transition: color 0.4s, background-color 0.4s;
display: flex;
vertical-align: middle;
line-height: 1em;
outline: none;
font-family: sans-serif;
text-align: left;
letter-spacing: 5px;
text-decoration: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
top: 50%;
left: 50%;
margin: 0 -125px;
width: auto;
}
.button:hover, .button:focus {
transition: color 0.4s, background-color 0.4s;
color: #009EE2;
text-decoration: none;
background-color: #FFFFFF;
}
.button:hover .arrow-right.icon {
transition: color 0.4s, background-color 0.4s;
color: #009EE2;
animation: expand 1.5s;
-webkit-animation: expand 1.5s;
animation-iteration-count: 1;
animation-fill-mode: forwards;
}
.arrow-right.icon {
color: #FFF;
background-color: transparent;
position: absolute;
margin-left: 20px;
margin-top: 7px;
width: 40px;
height: 1px;
background-color: currentColor;
}
.arrow-right.icon:before {
content: '';
position: absolute;
right: 1px;
top: -5px;
width: 10px;
height: 10px;
border-top: solid 1px currentColor;
border-right: solid 1px currentColor;
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
}
@keyframes expand {
0% {
transform: scaleX(1);
}
30% {
transform: scaleX(1.5);
}
60% {
transform: scaleX(1.5);
}
100% {
transform: scaleX(1.5);
}
}
@-webkit-keyframes expand {
0% {
transform: scaleX(1);
}
30% {
transform: scaleX(1.5);
}
60% {
transform: scaleX(1.5);
}
100% {
transform: scaleX(1.5);
}
}
This is my first time seeking help on Stack Overflow. Thank you in advance for any assistance (: