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 trialcody conner
Front End Web Development Techdegree Student 4,447 Pointsstuck on a challenge
Switch the order of the square arguments. Be sure to specify the variable for each argument.
Bummer: The mixin should take 2 parameters, '$size' and '$color'.
style.scss
@mixin square($color:black, $size) { width: $size; height: $size; border: 1px solid $color; } .box { @include square(50px, red); }
@mixin square($color:black, $size) {
width: $size;
height: $size;
border: 1px solid $color;
}
.box {
@include square(50px, red);
}
4 Answers
Rohald van Merode
Treehouse StaffHey cody conner 👋
Looks like you've currently switched the order of the parameters in the mixin itself 🙂
You'll instead want to switch the order of the arguments where the mixin is being called. After changing the order also make sure to specify the variable names for those arguments. Without specifying those the red
value will be used for the $size
and the 50px
value for the $color
, as that is the order that was initially defined 🙂
@mixin square($size, $color: black) {
width: $size;
height: $size;
border: 1px solid $color;
}
.box {
@include square($color: red, $size: 50px);
}
Hope this helps! 😃
cody conner
Front End Web Development Techdegree Student 4,447 Pointsim still getting this
Bummer: The mixin should take 2 parameters, '$size' and '$color'.
i appreciate your help.
this for some reason just catching me
michael apprich
9,989 PointsWhich step of the challenge is this?
michael apprich
9,989 PointsIt wants you to switch the order of the arguments being passed in the style rule and for you to define which is which by adding the argument name. So I believe it should look like this:
@mixin square($size, $color:black) {
width: $size;
height: $size;
border: 1px solid $color;
}
.box {
@include square($color:red, $size:50px);
}
cody conner
Front End Web Development Techdegree Student 4,447 Pointsthat worked. youre amazing. thanks everyone