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.

General Discussion

Please someone help

This is driving me insane. I am on the final challenge of Sass. I have to "Use the mixin we just wrote to create a series of classes for the colors: red, orange, yellow, and green."

This is the code I have which as far as I can see should work but for some reason it wont.

I keep getting the error "Bummer! The div with the class .red should have a red background. Did you use red as a parameter when including the rainbow mixin?"

@mixin square ($size, $color: black) {
    height: $size;
  width: $size;
  border: 1px solid $color;
  }

@mixin rainbow($colors...) {
  @each $color in $colors {
    .color.#{$color} {
      background: $color; }
  }
}


@include rainbow(red, orange, yellow, green);
.box {
    @include square($color: red, $size: 10px);

}

2 Answers

Tom Bedford
Tom Bedford
15,645 Points

You class names are compiling to .color.red, .color.orange etc. I think they should come out as .red, .orange, check your mixin.

THATS IT!!!! Thank you!