Sass: Use @each

Sass: Use @each
0

#1

The challange is Sass: Use @each to Map Over Items in a List
https://learn.freecodecamp.org/front-end-libraries/sass/use-each-to-map-over-items-in-a-list

<style type='text/sass'>
  @each $color in blue, black, red{
  .#{$color}-bg {background-color:$color;}
  }
  
  
  div {
    height: 200px;
    width: 200px;
  }
</style>

<div class="blue-bg"></div>
<div class="black-bg"></div>
<div class="red-bg"></div>

I just want to be sure I’m doing this right. Everything seems legit, but i’m not passing. Is there something i’ve done wrong?


#2

Can you format your code by hitting pre-formatted text in the editor?

Also please add a link to the exercise.


#3

I think it wants you do defile the colors separately. (not declare them in the each)