将sass转换为scss

时间:2013-02-13 18:59:16

标签: sass

您好我有这个混音和id喜欢把它改成SCSS mixin我真的很接近可以有人帮忙吗?

SASS
=animate($name: fadeIn, $duration: 1s, $delay: .2s, $function: ease, $mode: both)
  +experimental(animation, $name $duration $delay $function $mode)

What iv done so far in SCSS
@mixin animate($name, $duration, $delay, $function, $mode) {
animation: {
  name: $name; 
  duration: $duration; 
  delay: $delay; 
  function: $function; 
  mode: $mode;
 }
}

3 个答案:

答案 0 :(得分:1)

我在想这就是你要做的事。

<强> MIXIN:

@mixin animate($name, $duration, $delay, $function, $mode) {
   name: $name; 
   duration: $duration; 
   delay: $delay; 
   function: $function; 
   mode: $mode;
}

包含:

// SELECTOR TO ADD ANIMATION TO
.animation {
    @include animate(fadein, 1s, .2s, ease, both);
}

答案 1 :(得分:1)

SCSS =

@mixin animate($name, $duration, $delay, $function, $mode) {
   name: $name; 
   duration: $duration; 
   delay: $delay; 
   function: $function; 
   mode: $mode }

.animation {
    @include animate(fadein, 1s, .2s, ease, both) }

CSS =

.animation {
  name: fadein;
  duration: 1s;
  delay: 0.2s;
  function: ease;
  mode: both; }

答案 2 :(得分:-2)

你可以试试这个:

@mixin animate($name: fadeIn, $duration: 1s, $delay: 0.2s, $function: ease, $mode: both) {
    @include experimental(animation, $name $duration $delay $function $mode);
}