我敢肯定,這是一個新手問題,但我最近剛剛開始在我的項目中實現sass,我想知道是否有更容易/更有效的方法來使此代碼使用sass發生 - 謝謝你的幫助 :) 。我可以使用sass爲關鍵幀中的元素指定ID以減少CSS嗎?
我想分組,這樣我就可以通過ID來標識100%關鍵幀的寬度,而不是重寫動畫線和每個關鍵幀的關鍵幀。
span.underline {
display:block;
width:calc(100% - 130px);
height:2px;
background-color:transparent;
position:absolute;
left:41px;
}
#topNav .dropdown-menu>li>a:hover > span.underline#acctInfo {
animation: acctInfo 0.3s ease-out forwards;
background: #FFF;
}
@keyframes acctInfo {
0% {
width:0;
}
100% {
width:calc(100% - 130px);
}
}
#topNav .dropdown-menu>li>a:hover > span.underline#replenish {
animation: replenish 0.3s ease-out forwards;
background: #FFF;
}
@keyframes replenish {
0% {
width:0;
}
100% {
width:calc(100% - 60px);
}
}
#topNav .navbar-nav>li>a:hover > span.underline#more {
animation: more 0.3s ease-out forwards;
background: #FFF;
}
@keyframes more {
0% {
width:0;
}
100% {
width:calc(100% - 65px);
}
}