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 (retired) Advanced Sass Concepts Advanced Mixin Arguments

Define a box class. Use the square mixin to give it a height and width of 10px, and set the border to red.

Ok I'm stuck on this 3rd challenge, I rewatched the video and googled it but can't figure out what I'm doing wrong. This is what I have right now.

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

.square {
    @include square($color: black);
}

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

3 Answers

James Barnett
James Barnett
39,199 Points

Your issue is actually on step 2 ...

You don't create a new class to set a default value, check out the video at around time index 8:40 to brush up on how default values work.

Additionally at the end of the code challenge there is a give feedback button to the let the Treehouse team know about the issues you had with this code challenge.

/* Write your SCSS code below. */ @mixin square($size, $color: black){ height: $size; width: $size; border: 1px solid $color; }

.box { @include square (10px, red);
}

OK thanks. Yea, I took a break and watched the video again and started from scratch. You're right, I made a mistake on step 2 and it accepted my answer that's why that threw me off.