Using NTH to loop through a list of lists with rules

By looping through the list $styles that is populated with lists, we can set each property by separating the property and value pair with the nth-function.

$styles: background #333333, margin 20px, padding 10px;

.factory {
  @each $style in $styles {
      #{nth($style, 1)}: nth($style, 2);
    }
}

Add your comment