3

嗨,我有这个 sass mixin,我想将其更改为 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;
 }
}
4

3 回答 3

1

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

混心:

@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);
}
于 2013-02-13T20:06:02.047 回答
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; }
于 2013-02-14T00:53:56.887 回答
-2

你可以试试这个:

@mixin animate($name: fadeIn, $duration: 1s, $delay: 0.2s, $function: ease, $mode: both) {
    @include experimental(animation, $name $duration $delay $function $mode);
}
于 2016-02-16T12:50:08.090 回答