请考虑以下几点:
.flashing {
.flashKeyFrames(fade-in;{
0%, 100% {opacity: 1;}
50% {opacity: 0;}
});
.flashing(fade-in linear infinite alternate; 1s)
}
.flashKeyFrames(@name; @arguments) {
@-moz-keyframes @name { @arguments(); }
@-webkit-keyframes @name { @arguments(); }
@keyframes @name { @arguments(); }
}
.flashing(@arguments, @duration) {
-webkit-animation: @arguments;
-moz-animation: @arguments;
animation: @arguments;
-webkit-animation-duration: @duration;
-moz-animation-duration: @duration;
animation-duration: @duration;
}@arguments后面的括号必须是什么?我以为括号是可选的当使用混合?所以我假设@arguments没有被定义为一个混合体,但是它是什么呢?
发布于 2016-05-04 10:04:35
不,在.flashKeyFrames中使用的.flashKeyFrames是,而不是mixin。它是一个传递给的参数。设置为此参数的值集是一个http://lesscss.org/features/#detached-rulesets-feature,对于一个分离的规则集调用,末尾的括号()是强制性的。以下是较少网站的摘录:
分离规则集调用后的括号是强制。调用
@detached-ruleset;不起作用。
只有在调用混和而不是规则集时,括号才是可选的。
https://stackoverflow.com/questions/37024361
复制相似问题