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 Sass Basics (retired) Speeding up Workflow with Sass Sass Functions

Use the double function you just wrote to refactor this code: div { font-size: 5px * 2; }

Did a little searching and I am coming up short. The red tip says to call my new double function, which i did, and then to assign the result to my div tag which it should be doing. Can anyone help please, and thank you

/* Write your SCSS code below. */
@function double ($input){
 @return $input * 2;
}

div {
double(5px);
}

12 Answers

This is the Correct Answer

@function double($input) {
    @return $input * 2;
}

div { 
  font-size: unquote(double(5) + "px"); 
}
Marcin Robert Kaźmierczak
Marcin Robert Kaźmierczak
33,570 Points

Adam Moore How did you get that amount of points with that kind of mistake...

/* Write your SCSS code below. */ @function double ($input){ @return $input * 2; }

div { font-size: double(5px); }

Matias Valenzuela
Matias Valenzuela
7,554 Points
div {
  font-size: double(5px);
}
Adam Moore
Adam Moore
15,825 Points

Gotcha.

Try div { font-size: double(5px); }

Milmon Harrison
Milmon Harrison
10,188 Points

You don't need to add @include when you call double(5px);

div { font-size: double(5) + unquote("px"); }

I am smacking my head lol how did i miss that....thanks Adam

div { font-size: double(5) + unquote("px"); }

This worked for me.

```/* Write your SCSS code below. */ @function double($input) { @return $input * 2; }

$lol: double(5px);

div { font-size: $lol; }```

Jordan Leigh
Jordan Leigh
15,229 Points

div{ font-size: double(5px); }

Marcio Gessoni
Marcio Gessoni
14,941 Points

Hi guys I found this solution it worked out perfectly:

@function double ($input){ @return $input * 2; }

div { font-size: unquote(double(5) + "px"); }

Adam Moore
Adam Moore
15,825 Points

To call the function inside your div you need to @include

So @include double(5px);

well i thought it would work....no dice

/* Write your SCSS code below. */
@function double ($input){
 @return $input * 2;
}


div {
@include double(5px);
}

output this Bummer! Call your new 'double' function with an argument of 5px. Use the result to set the font-size attribute of 'div' tags.