Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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,567 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.