Freecodecamp: Sass Challenge:Use @each to Map Over Items in a List

Created on 14 Mar 2018  ·  3Comments  ·  Source: freeCodeCamp/freeCodeCamp



Challenge Name

Use @each to Map Over Items in a List

https://beta.freecodecamp.org/en/challenges/sass/use-each-to-map-over-items-in-a-list

Issue Description


My code clearly works and provide the right result in the preview section but for some reason I don't
understand I don't pass the challenge.

Browser Information

  • Browser Name, Version: Chrome 64.0.3282.186
  • Operating System: Windows 7
  • Mobile, Desktop, or Tablet:

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

Screenshot


screenshot-2

help wanted learn

Most helpful comment

Looking in the source it appears the test is missing the . required for class selectors
See below the assert is using blue-bg and should be .blue-bg
"assert($('blue-bg').css('background-color') == 'rgb(0, 0, 255)', 'message: Your .blue-bg class should have a background-color of blue.');",

this is lines 318-320 of
freeCodeCamp/seed/challenges/03-front-end-libraries/sass.json

All 3 comments

Looking in the source it appears the test is missing the . required for class selectors
See below the assert is using blue-bg and should be .blue-bg
"assert($('blue-bg').css('background-color') == 'rgb(0, 0, 255)', 'message: Your .blue-bg class should have a background-color of blue.');",

this is lines 318-320 of
freeCodeCamp/seed/challenges/03-front-end-libraries/sass.json

Do you know if anybody is going to fix this issue?

@sjames1958gm Nice catch there! Are you interested in fixing the tests?
Here is the Contributing Guide that you should refer to, and the Contributors chat room if you need help.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ar5had picture ar5had  ·  3Comments

SaintPeter picture SaintPeter  ·  3Comments

bagrounds picture bagrounds  ·  3Comments

vaibsharma picture vaibsharma  ·  3Comments

danielonodje picture danielonodje  ·  3Comments