Sass @each

The @eachopen in new window makes it easy to output styles or evaluate a block of code for each element in a listopen in new window or each key value pair in a mapopen in new window.

$colors: red, blue, green, orange;

%box {
  display: inline-block;
  width: 100px;
  height: 100px;
}

@each $color in $colors {
  .box-#{$color} {
    @extend %box;
    background-color: $color;
  }
}