封装:
/**
* animation
*/
.keyframes (@prefix,@name,@content) when (@prefix=def) {
@keyframes @name {
@content();
}
}
.keyframes (@prefix,@name,@content) when (@prefix=moz) {
@-moz-keyframes @name {
@content();
}
}
.keyframes (@prefix,@name,@content) when (@prefix=o) {
@-o-keyframes @name {
@content();
}
}
.keyframes (@prefix,@name,@content) when (@prefix=webkit) {
@-webkit-keyframes @name{
@content();
}
}
.keyframes (@prefix,@name,@content) when (@prefix=all) {
.keyframes(moz,@name,@content);
.keyframes(o,@name,@content);
.keyframes(webkit,@name,@content);
.keyframes(def,@name,@content);
}
自定义动画:
.keyframes(all,zindexName,{
from{z-index :;}
to{z-index: -}
});
调用:
-webkit-animation: zindexName 0.6s linear .1s ;
https://www.jianshu.com/p/b19682ba87e2
less 语法