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

IDK WHAT IM DOING

Write a function, named multiply, that takes a value as an argument, then returns that value multiplied by 2.

http://teamtreehouse.com/library/advanced-sass/advanced-variables-mixins-functions-and-placeholders/functions

1 Answer

Kevin Korte
Kevin Korte
28,148 Points

What have you tried so far?

Take a look at the Sass documentation found here: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#function_directives

Every sass function starts with @function, than the function name, and any variables to pass into the function inside parentheses. Inside the curly braces we have to @return something. In this case it's whatever the value we passed in as a variable * 2.

The example function on the Sass docs I linked above shows you exactly the syntax you need. Try plugging in the rest of the specifics of the questions into the syntax and see if you can't get it right.

Let me know how it goes.

my code: lol

@function (multiply)

Kevin Korte
Kevin Korte
28,148 Points

That's a start. I expanded above. Let me know if that helps you solve it for yourself.

my code: whats wrong with it?

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

Kevin Korte
Kevin Korte
28,148 Points

Functions use @return instead of $return

thank u so much