Closed szepeviktor closed 10 years ago
Could this be the answer?
@myWiggle: {
10% { #rotate(14deg); }
20% { #rotate(-12deg); }
30% { #rotate(10deg); }
40% { #rotate(-8deg); }
50% { #rotate(6deg); }
60% { #rotate(-4deg); }
70% { #rotate(3deg); }
80% { #rotate(-2deg); }
90% { #rotate(1deg); }
100% { #rotate(0deg); }
};
#rotate(@deg){
@{vendor}transform: rotate(@deg);
}
#doKeyFrames(@name; @frames) {
@-webkit-keyframes @name {
@vendor: -webkit-;
@frames();
}
@-moz-keyframes @name {
@vendor: -moz-;
@frames();
}
@-o-keyframes @name {
@vendor: -o-;
@frames();
}
@keyframes @name {
@vendor: ~'';
@frames();
}
}
#doKeyFrames(wiggle; @myWiggle);
LESS Hat is just about not worying about vendor prefixes again. You can use this syntax and it will correctly generate everything for you :)
.keyframes(~'animationName, 0%{ transform: scale(1.5); color: blue; } 100%{ transform: scale(2); color: red }');
You can read more about this feature in the README of this repo
Feel free to discuss on if you are trying to do anything special that the standard routine doesn't cover
Do you have a solution for
that prevents all prefixes selectors × all prefixes attributes version? Like