您好我有这个混音和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;
}
}
答案 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);
}