Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS Advanced Sass Advanced Directives @each

Bernardo Cassina
Bernardo Cassina
13,523 Points

SassmMeister seem OK but i can`t complete the challenge

The message is: Bummer! The background-color in .Greenbay should be green. My sassmeister output looks ok:

.to-lower-case GreenBay {
  background-color: green;
  border: 1px solid yellow;
}
.to-lower-case GreenBay:after {
  content: "Your GreenBay Packers";
  color: yellow;
}

My code is:

$teams: (GreenBay Packers green yellow) (Seattle Seahawks blue green) (Chicago Bears blue orange);

@each $name, $named, $color, $border in $teams {

   .#{to-lower-case ($name)} {

    background-color: $color;

    border: 1px solid $border;

    &:after {
       content: 'Your' + ' ' + $name + ' ' + $named;
       color: $border; 
    }
  }
}

2 Answers

Wayne Priestley
Wayne Priestley
19,579 Points

Hi Bernardo,

You have a small error, and a bit of code missing.

$teams: (GreenBay Packers green yellow) (Seattle Seahawks blue green) (Chicago Bears blue orange);

@each $name, $named, $color, $border in $teams {
.#{to-lower-case($name)} { /* no space between -case( */
    background-color: $color;
    border: 1px solid $border; /* $border instead of yellow */
    &:after {
      content: 'Your' + ' ' + $name + ' ' + $named;
      color: $border; 
    }
  }
}

Hope this helps.