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
Hal Borland
1,227 PointsCode Challenge Stage 2 Sass mixins
Have been stuck on this one and everything looks ok but it keeps failing wit the following error. Bummer! The mixin needs to set the height attribute to half of the value in the $size parameter.
Code
@mixin button($color, $size) {
background: $color;
width: $size;
height: $size * 0.5;
}
.menu_button {
@include button(#ccc, 500);
}
Output
.menu_button {
background: #cccccc;
width: 500;
height: 250; }
3 Answers
Kevin Korte
28,149 PointsYour code would work in the wild, but the code engine here is picky, and only accepts it a certain way. Change your code to
height: $size / 2;
and it should pass you through.
Hal Borland
1,227 PointsThanks Kevin!
Kevin Korte
28,149 PointsYou're welcome!
James Barnett
39,199 PointsJames Barnett
39,199 PointsThat seems like an overly specific code correctness check to me. I'd say it could be reported as a bug.
Hal Borland
1,227 PointsHal Borland
1,227 PointsYeah. I'll submit it as a bug. Thanks James.
Kevin Korte
28,149 PointsKevin Korte
28,149 PointsThey should give you the option to do it either way.
James Barnett
39,199 PointsJames Barnett
39,199 PointsKevin Korte -
>They should give you the option to do it either way.Definately.
Hal Borland
1,227 PointsHal Borland
1,227 PointsI just submitted it as a bug.
Jay McGavren
Treehouse TeacherJay McGavren
Treehouse TeacherThanks for doing so! It was indeed an overly-specific test. Should be fixed now. Sorry for the trouble!
James Barnett
39,199 PointsJames Barnett
39,199 PointsJay McGavren - That's a pretty quick turn around over the Holiday. Rock on!