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 trialTrue Andrews
Front End Web Development Techdegree Student 10,520 Points@Mixin issue
How is the @mixin supposed to be set up?
@mixin square ($size,$color:black) {
width: $size;
height: $size;
border: 1px solid $color;
}
.box {
@mixin square ($size: 50px,$color: $red) {
border: 1px solid $color;
height: $size;
width: $size;
}
}
1 Answer
Jamie Reardon
Treehouse Project ReviewerYou are almost there! You just need to change your incorrect .box rule. Here you have declared the mixin twice, you don't do that. You define a mixin by typing the @mixin directive like you have done at the beginning of the code. To use the mixin, you need to use the @include directive, which allows you to use the mixin. Check below:
.box {
@include square(50px, red);
}