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

CSS

Hal Borland
Hal Borland
1,227 Points

Code 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
Kevin Korte
28,149 Points

Your 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.

James Barnett
James Barnett
39,199 Points

That seems like an overly specific code correctness check to me. I'd say it could be reported as a bug.

Hal Borland
Hal Borland
1,227 Points

Yeah. I'll submit it as a bug. Thanks James.

Kevin Korte
Kevin Korte
28,149 Points

They should give you the option to do it either way.

James Barnett
James Barnett
39,199 Points

Kevin Korte -

> They should give you the option to do it either way.

Definately.

Hal Borland
Hal Borland
1,227 Points

I just submitted it as a bug.

Jay McGavren
Jay McGavren
Treehouse Teacher

Thanks for doing so! It was indeed an overly-specific test. Should be fixed now. Sorry for the trouble!

James Barnett
James Barnett
39,199 Points

Jay McGavren - That's a pretty quick turn around over the Holiday. Rock on!