我最近更新到 Compass 1.0.16 版,正在设置新动画内容的基本使用。出于某种原因,当我尝试为不同的动画设置设置默认值时,它们不会生效,需要我在整个应用程序中对这些值进行硬编码。
具体来说:
$default-animation-duration: 0.5s;
@import "compass/css3";
@include keyframes(slideOutLeft) {
0% {
@include transform(translateX(0%));
}
100% {
@include transform(translateX(-100%));
}
}
#id {
@include animation(slideOutLeft); // Doesn't work
}
#id2 {
@include animation(slideOutLeft 0.5s); // Does work.
}
有什么想法吗?
最佳答案
Compass 人员的官方消息可以在这里找到:https://github.com/chriseppstein/compass/issues/1556
Yeah, currently the defaults are only used in the long-form properties e.g. animation-duration(), or in when no arguments other are passed e.g. animation() (where all the defaults are used). Not sure that's the best way, but the defaults are pretty invasive otherwise.
关于css - compass $default-animation-duration 没有被使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21705680/