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 trialSergey Filimonov
5,878 PointsCannot pass the Task 4/6
Task 4/6 where I need to switch arguments to make the code invalid in the last exercise is not working :(
@mixin square($size, $color: black) { width: $size; height: $size; border: 1px solid $color; }
.box { @include square(red, 10px); }
2 Answers
Kevin Kenger
32,834 PointsHey Sergey,
In order to switch the arguments, you need to make sure you're specifying which variable you want to assign the value to. Otherwise, you'd be assigning red to the $size variable and 10px to $color variable, which would make the code fail.
Try this:
@mixin square ($size, $color: black) {
height: $size;
width: $size;
border: 1px solid $color;
}
.box {
@include square($color: red, $size: 10px);
}
Sergey Filimonov
5,878 PointsThank you Kevin Kenger !