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

Gareth Partridge
Gareth Partridge
13,408 Points

Switch the order of the square arguments. Be sure to specify the variable for each argument.

I am not sure what needs to be switched exactly ? please help

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

1 Answer

Steven Parker
Steven Parker
221,500 Points

You're close. You've named the arguments in the switched order, but you still need the values to go with them.

Gareth Partridge
Gareth Partridge
13,408 Points

Hi Steven

sorry but what are the values ?

Jamie Reardon
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Jamie Reardon
Treehouse Project Reviewer

He means you need to also switch the values (which are ones in the parenthesis of your box include rule.

Steven Parker
Steven Parker
221,500 Points

The values that the challenge instructions ask for are "red" for the color and "20px" for the size.
I'd guess they were there when you passed task 1 but got removed?

Gareth Partridge
Gareth Partridge
13,408 Points

Hi Steven

the values were not in the first question, thats also confusing me a bit.

.box { @include square($color, $size: 50px red); }

.box { @include square($color, $size: red 50px); }

I have tried putting the values everywhere and I keep getting the same error, I have re watched the video a few times as well, I must be complicating these functions somewhere.

Steven Parker
Steven Parker
221,500 Points

The values need to be individually paired with the names:

.box { @include square($color:red, $size:50px); }
Gareth Partridge
Gareth Partridge
13,408 Points

Thanks, I see now how obvious it was. I will have to give these functions more practice.