gpt4 book ai didi

css - 让 Compass 将供应商前缀添加到动画选择器

转载 作者:行者123 更新时间:2023-11-28 10:18:05 26 4
gpt4 key购买 nike

谁能告诉我如何让 Compass 在编译时将供应商前缀添加到 CSS3 动画选择器?我的配置文件如下所示。

http_path = "/"
css_dir = "/"
sass_dir = "/"
images_dir = "img"
javascripts_dir = "js"

output_style = :expanded
relative_assets = true
line_comments = false

我试过向它添加 Compass::BrowserSupport.add_support("animation", "webkit", "moz", "ms"),但它不起作用。


编辑

为了回应 cimmanon 的评论,我想避免像这样重复每个选择器:

.big-wheel {
left: 77px;
bottom: 11px;
-webkit-transform: rotate(0deg);
-webkit-animation-name: wheels;
-webkit-animation-duration: 0.25s;
-webkit-animation-iteration-count: infinite;
-moz-transform: rotate(0deg);
-moz-animation-name: wheels;
-moz-animation-duration: 0.25s;
-moz-animation-iteration-count: infinite;
-ms-transform: rotate(0deg);
-ms-animation-name: wheels;
-ms-animation-duration: 0.25s;
-ms-animation-iteration-count: infinite;
transform: rotate(0deg);
animation-name: wheels;
animation-duration: 0.25s;
animation-iteration-count: infinite;
}

最佳答案

Compass 确实为 transform 内置了一个 mixin

我没有看到网站上记录的其他元素的混入。如果您需要使用 experimental mixin,Compass 可以让您轻松编写自己的 compass .

.foo {
@include experimental('animation-name', wheels, webkit, moz, o, ms, not khtml);
@include experimental('animation-duration', 0.25s, webkit, moz, o, ms, not khtml);
// alternate way of setting prefixes
$animation-support: webkit, moz, o, ms, not khtml;
@include experimental('animation-iteration-count', infinite, $animation-support...);
}

编译为:

.foo {
-webkit-animation-name: wheels;
-moz-animation-name: wheels;
-ms-animation-name: wheels;
-o-animation-name: wheels;
animation-name: wheels;
-webkit-animation-duration: 0.25s;
-moz-animation-duration: 0.25s;
-ms-animation-duration: 0.25s;
-o-animation-duration: 0.25s;
animation-duration: 0.25s;
-webkit-animation-iteration-count: infinite;
-moz-animation-iteration-count: infinite;
-ms-animation-iteration-count: infinite;
-o-animation-iteration-count: infinite;
animation-iteration-count: infinite;
}

关于css - 让 Compass 将供应商前缀添加到动画选择器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17618082/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com