我有這個SASS混入,應該讓一個按鈕閃爍:爲什麼-webkit-keyframes無法在我的SASS mixin中工作?
@mixin background_animation($color) {
-webkit-animation: backgroundAnimation 800ms infinite;
@-webkit-keyframes backgroundAnimation {
0% {background-color: $color;}
50% {background-color: red;}
100% {background-color: $color;}
}
}
我使用它是這樣的:
@include background_animation(#000000);
但是,它不工作。該按鈕的背景顏色不會閃爍。
有人可以告訴我我在這裏失蹤了嗎?
P.S.代碼工作正常時,不包括它作爲一個混合。
生成CSS是這樣的:
-webkit-animation-delay: 0s;
-webkit-animation-direction: normal;
-webkit-animation-duration: 0.800000011920929s;
-webkit-animation-fill-mode: none;
-webkit-animation-iteration-count: infinite;
-webkit-animation-name: backgroundAnimation;
-webkit-animation-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);
... other rules omitted for brevity
生成的CSS看起來像什麼? – cimmanon
@cinnamoon:我更新了我的OP。 – Tintin81
所提供的代碼不可能生成該CSS。 – cimmanon