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 Sass Basics Add Reusable Logic to Your Sass Advanced Mixins Challenge

Nela Kay
Nela Kay
11,855 Points

I don't understand where to set the values of $color...

I created the mixin, but I'm not sure where to set the values of the variable $color. First I thought the value for that parameter has to be set inside the call of the mixin, but the challenge kept on asking for those values. So, I tried adding it in the parenthesis (after $color: 1px solid), although I knew that was kind of vague. I trief to set the values in the border declaration using border: 1px solid; But it asked me to set the values for $color to 1px solid. Then I created a call below, just to see what happened. Nothing. Maybe somebody knows the answer, because even after watching the previous videos three times, I didn't get it. I might be looking in the wrong direction...

Thank you so much!

style.scss
@mixin square ($size, $color) {
  height: $size;
  width: $size;
  border: $color;
}

@include square ($color: 1px solid);

2 Answers

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

Nela Kay
Nela Kay
11,855 Points

Ohhhhh! I just understood the question in a different way!

Thank you so much for replying so quick! I hope you have a nice day!