19

是否可以使用 Compass 或 SASS 输出以下 CSS 转换,该转换将输出所有各种供应商前缀:

-webkit-transition: all 0.3s ease-in-out;

谁能指出我正确的图书馆?

4

3 回答 3

53

使用指南针的transitionmixin

@include transition(all 0.3s ease-in-out);
于 2013-01-13T06:48:04.093 回答
6

Mixin 用于使用单个或“全部”属性转换创建动画

@include transition(PROPERTY DURATION DELAY(OPT) TIMING-FUNCTION)
@mixin transition($transition) {
  -webkit-transition: $transition;
     -moz-transition: $transition;
      -ms-transition: $transition;
       -o-transition: $transition;
          transition: $transition;
}

Mixin 用于使用多个属性转换创建动画

@include multi-transition("PROPERTY DURATION DELAY(OPT) TIMING-FUNCTION, PROPERTY DURATION DELAY(OPT) TIMING-FUNCTION")
@mixin multi-transition($transition) {
 -webkit-transition: #{$transition};
    -moz-transition: #{$transition};
     -ms-transition: #{$transition};
      -o-transition: #{$transition};
         transition: #{$transition};
}
于 2014-04-08T22:54:23.230 回答
0

SASS 混合

@mixin transition($transition){
     -webkit-transition: $transition;
     -moz-transition: $transition;
     -o-transition: $transition;
     transition: $transition;
}

@include transition(all 0.3s ease-in-out);
于 2016-11-25T10:21:14.937 回答