User Tools

Site Tools


sasset:looping_through_lists_with_for
no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


sasset:looping_through_lists_with_for [2016/04/02 14:42] (current) – created leo
Line 1: Line 1:
 +|<- [[Conditional @if statements and argument lists]]|[[Going through a list with @each]] ->|
  
 +@for permet d'itérer parmi les éléments d'une liste.
 +
 +<code>
 +$colors: $red, $green, $blue;
 +
 +@for $item from 1 through length($colors) {
 +  h#{$item} {
 +    color: nth($colors, $item);
 +  } 
 +}
 +</code>
 +
 +-> http://sass-lang.com/documentation/file.SASS_REFERENCE.html#_10
 +
 +-> Voir aussi @while dans la doc ci-dessus, un peu différente
sasset/looping_through_lists_with_for.txt · Last modified: 2016/04/02 14:42 by leo