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 trialGreg Galus
13,228 PointsSass Code Challenge- Power of Mixins
I am stuck on this code challenge. It is not passing me and from what I can see my code is correct. Am I missing something? Task: Use the mixin on a class called ".menu_button". Set the background color to be #369 and the size to be 50px.
My Code:
@mixin button($color, $size){
background: $color;
height: $size /2;
width: $size;
}
.menu-button{
@include button(#369, 50px);
}
8 Answers
Tom Bedford
15,645 Points".menu_button" and ".menu-button" are not the same :)
Tom Bedford
15,645 PointsHi Martin, you have a colon after .menu_button which may be breaking things.
Martin Ruston
30,736 PointsI'm getting the same error message my code is below, it looks correct to me.
@mixin button($color, $size) {
background: $color;
width: $size;
height: $size / 2;
}
.menu_button: {
@include button(#369, 50px);
}
MUZ140018 Sibusisosenkosi Moyo
8,693 Pointsits .menu_button { @include button (#369,50px); }
MUZ140700 Emmanuel Sibanda
4,957 Pointsthank you. helped a lot
Greg Galus
13,228 PointsThis is the error message I get: Bummer! The background color should be set to #369.
Greg Galus
13,228 PointsUgh! Of course they're not. That was the problem. Thanks for the help Tom.
Martin Ruston
30,736 Pointswoops, thank you
Joshua Russo
10,037 PointsI had issues with this too. When you do .menu_button { @include button } your true css output is ".menu_button button". This can't be right. So I did this:
/* Write your SCSS code below. */ @mixin button ($color, $size) { button { background: $color; width: $size; height: $size/2; } } .menu_button { background: #369; width: 50px; }