指南针多个CSS过渡

像这样的JsfiddleCompass如何进行多个CSS转换

我想做的是用Compass在下面基本编写此代码。

-webkit-transition: top 0.3s ease-out, background .9s .5s ease-out; 
   -moz-transition: top 0.3s ease-out, background .9s .5s ease-out; 
     -o-transition: top 0.3s ease-out, background .9s .5s ease-out; 
        transition: top 0.3s ease-out, background .9s .5s ease-out;
番长2020/03/24 09:55:51

这是你想要的?http://compass-style.org/reference/compass/css3/transition/#mixin-transition

@include transition( top 0.3s ease-out, background .9s .5s ease-out );

番长猴子2020/03/24 09:55:51

如果您使用mixin定义转换,则会出现此错误:

错误:mixin转换仅需要1个参数;给定2

尝试将您的值放在括号之间,例如:

@include transition( (bottom .5s, background 2s) );
蛋蛋猿2020/03/24 09:55:51

从文档中:http :
//compass-style.org/reference/compass/css3/transition/#mixin-transition

多年来,它可能已经发生了变化,但现在是这样的:

single-transition($property, $duration, $function, $delay)

请注意,$ delay是最后一个,而不是正确答案在最后一个之前的位置。