animation-fill-modeのアニメーションの後にトランジションが機能しません。 最初のアニメーションは開始され、ホバーで終了しますが、アンオーバーされた後はアニメーションが適用されません。
Codepen here
それはChromeとSafariで再現。 Firefoxでうまく動作します。
パグ:
button Button
SCSS:
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
button {
padding: 5px 0;
position: relative;
border: none;
border-radius: 0;
background: transparent;
outline: none;
cursor: pointer;
font-weight: 700;
text-transform: uppercase;
&:before {
content: '';
position: absolute;
bottom: 0;
left: 100%;
right: 0;
height: 4px;
border-radius: 2px;
background: blue;
transition: all .25s;
}
&:hover {
&:before {
animation: nav-link-hover .25s forwards;
}
}
}
@keyframes nav-link-hover {
0% {
left: 0;
right: 100%;
}
100% {
left: 0;
right: 0;
}
}
がUPDATE
私は、回避策を見つけたが、それが良いか、例えばになる場合どんな答えを待ち、喜んでそれを受け入れます破損したキーフレームを正常に使用します。