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 Advanced Sass Advanced Functions Introspection: Part 2

Kabolobari Benakole
PLUS
Kabolobari Benakole
Courses Plus Student 14,278 Points

Strange Again

While my evaluates in Sassmeister... Treehouse still says Bummer

$ems: 2em; $pixels: 5px; $percents: 25%; $inches: 1in;

@function add-if-comparable($alpha, $bravo) { @if comparable($alpha, $bravo) { @return ($alpha + $bravo); } @else { @error "Error"; } }

.block { display: block; background-color: orange; font-size: add-if-comparable($ems, $ems); content: add-if-comparable($pixels, $percents); }

style.scss
$ems: 2em;
$pixels: 5px;
$percents: 25%;
$inches: 1in;

@function add-if-comparable($alpha, $bravo) {
  @if comparable($alpha, $bravo) {
        @return ($alpha + $bravo);
    } @else {
        @error "Error";
    }
}

.block {
  display: block;
  background-color: orange;
  font-size: add-if-comparable($ems, $ems);
  content: add-if-comparable($pixels, $percents);
}

1 Answer

Steven Parker
Steven Parker
229,783 Points

You're really close! The instructions say that "add-if-comparable should return the string 'error'", but this code has "@error" instead of "@return".

Also, the challenge is expecting the string "error" (lower-case) instead of "Error" (capital "E").

Fix those issues and you should pass.