[Re-Open] Issue with test case in SASS section

Hi, I’m trying to resolve the challenge Sass: Use @each to Map Over Items in a List

I see the result is right, but test case always notify I’m incorrect 3 cases as follow:

  1. Your .blue-bg class should have a background-color of blue.
  2. Your .black-bg class should have a background-color of black.
  3. Your .red-bg class should have a background-color of red.

This is my code:

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

<div class="blue-bg"></div>
<div class="black-bg"></div>
<div class="red-bg"></div>type or paste code here

And this is my screen:

Please help me answer test case wrong or my code wrong? Thank you!

Note: the same issuse in Sass: Apply a Style Until a Condition is Met with @while section

Your code passes all tests for me. Are you by any chance using Edge, IE, or Safari as your browser? These have decided not to implement new features of JS and CSS according to web standards and as a result they often exhibit unintended (and frustrating) behavior.

Hi, thanks for your feedback.

I’ve tried use newer Chrome version. And it work well. So I think the reason is Chrome version.

I’m having the same problem. My code doesn’t work on fully-updated Chrome or Safari.

Here’s the code

<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>

For me your code is correct. And my chrome version is 67.0.3396.99 (Official Build) (64-bit).

I’m on the same version of Chrome:

Version 67.0.3396.99 (Official Build) (64-bit)

I’m getting the right result, but the test won’t pass. Same with the next assignment ‘Apply a Style Until a Condition is Met with @while

When I check the styling for each element in DevTools, the classes and styling are all correct, but the tests aren’t passing. I’m going to check github again, maybe someone has mentioned a bug there.

I edited the title to Re Open and hope someone fro.m freecodecamp help you😊

No worries! I found an open thread on github. Looks like three of the SASS challenges are giving people problems. You can cludge together solutions for some of them by removing spaces/indentation and then spamming the “run tests” button (I just got this one to work by doing that.)
Looks like they’re hoping to have someone help fix the bug in the testing framework.
Thanks though!