css - compass $default-animation-duration 没有被使用?

标签 css animation sass compass-sass

我最近更新到 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/

相关文章:

jquery - 为什么这个用于从 div 中删除边框的 jQuery 代码不起作用?

python - 如何在 Plotly 中制作热图动画

javascript - HTML 中类似桌面的过渡效果

css - 如何观看sass文件

css - SCSS Sprite 位置计算生成无效的 CSS

javascript - 将动态 HTML 类存储为 JS 变量

python - 在管理页面的 collectstatic 没有 css 之后

javascript - 当我裁剪照片时,它们最终将标题隐藏在缩略图中

java - 使用箭头键时我的图像消失

css - 带@font-face 的 Sass 占位符