Utilisation d'un bloc de code pour l'animation en LESS
Créons une fonction qui définit les images clés d'une animation :
.keyframes(@name, @code) {
@keyframes @name {@code();}
}
Utilisons notre fonction :
.keyframes(anim, {
from {
width: 100px;
}
to {
width: 200px;
}
});
Résultat de la compilation :
@keyframes anim {
from {
width: 100px;
}
to {
width: 200px;
}
}