我有这个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