Pairing 2 lists together with Zip function and loop through it

Pairing 2 lists together with Zip function and loop through it setting the background to each color with a class name of author-name,
Output in .css: .author-alex {background:red;} etc…

$authors: nick dave jen joe trixy;
$colors: red purple green blue;
$author-style: zip($authors, $colors);
@each $a in $author-style{
  .author-#{nth($a, 1)}{
  	background: nth($a, 2);
  }
}

Add your comment