CSS Sass Basics Write Smart and Efficient CSS with Sass Write a Sass Function

Charlene Janzen
Charlene Janzen
9,807 Points

My code seems correct, but the quiz returns an error.

My code is:

@function px-to-rem($target, $context: $base-font-size) { @return($target / $context) * 1rem; }

The error says "Make sure you're dividing $target by $context.

style.scss
$base-font-size: 16px;

// Write your function here

@function px-to-rem($target, $context: $base-font-size) {
    @return($target / $context) * 1rem;
}

1 Answer

Steven Parker
Steven Parker
207,597 Points

The challenge is expecting a space after the @return keyword:

    @return ($target / $context) * 1rem;