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 concepts Challenge task 4 of 6

I can't seem to get this code to work, no matter what I try.... Here's the code:

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

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

the error I'm getting is this:

Bummer! Try to reverse the order of the arguments when you include the mixin. You'll need to specify the variable for each argument.

what am I doing wrong. Even the codes that passed for others that haad this same issue aren't passing for me....

Dave McFarland
Dave McFarland
Treehouse Teacher

Hi James,

Your SASS code wasn't showing up correctly. I fixed it in your post.

For the future, to put HTML/CSS/SASS/JavaScript in a forum post:

  1. hit return to create a new line and type three back tick characters ```

  2. hit return to create another new line and paste your HTML

  3. hit return and add three more back tick characters: ``` The back tick character isn't the same as the single quote -- ' -- mark; the back tick is located on the same key as the ~ on most keyboards.

Also to add correct color highlighting add the name of the language after the back ticks like this: ```CSS. Here's what CSS should look like in a forum post:

#gallery li {
  float: left;
  width: 45%;
}

3 Answers

Dave McFarland
STAFF
Dave McFarland
Treehouse Teacher

I got the same error as you when I copied and pasted your code. However, if you get rid of the space after the opening ( and before the closing ) it works:

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

This must be a bug in the code challenge software.

Thanks...

Thanks! why were the spaces causing the error to be wrong?

Dave McFarland
Dave McFarland
Treehouse Teacher

I don't know. It's not technically wrong, but the code challenge engine doesn't seem to like it.

Jay McGavren
Jay McGavren
Treehouse Teacher

As Dave said, your answer should have been accepted. We've modified this challenge so that similar spacing will be accepted in the future. Sorry for the trouble!