@while - tant que
@while vous permet d'exécuter une boucle.
Exemple :
$i: 6;
@while $i > 0 {
.item-#{$i} {width: 2em * $i;}
$i: $i - 2;
}
Résultat CSS après compilation :
.item-6 {width: 12em;}
.item-4 {width: 8em;}
.item-2 {width: 4em;}
@while vous permet d'exécuter une boucle.
Exemple :
$i: 6;
@while $i > 0 {
.item-#{$i} {width: 2em * $i;}
$i: $i - 2;
}
Résultat CSS après compilation :
.item-6 {width: 12em;}
.item-4 {width: 8em;}
.item-2 {width: 4em;}