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

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!