Zbatimi i bllokut të kodit për animacion në LESS

Le të krijojmë një funksion që përcakton kornizat kyçe të animacionit:

styles.less.keyframes(@name, @code) {
  @keyframes @name {@code();}
}

Le të përdorim funksionin tonë:

styles.less.keyframes(anim, {
  from {
    width: 100px;
  }
  to {
    width: 200px;
  }
});

Rezultati i kompilimit:

styles.css@keyframes anim {
  from {
    width: 100px;
  }
  to {
    width: 200px;
  }
}