Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS Sass Basics (retired) Speeding up Workflow with Sass Sass Functions

Stuck on Sass challenge and possibly next 2 challenges also

Pls help

index.html
<!DOCTYPE html>
<html>
<head>
  <title>Sass Basics - Code Challenge</title>
  <link rel="stylesheet" type="text/css" href="page-style.css">
  <link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
  <div>
    <p>
      Bacon ipsum dolor sit amet biltong capicola meatball, corned beef venison tongue meatloaf ham sausage jerky short loin bacon. Shoulder pork pig, pancetta turducken flank strip steak prosciutto jerky venison.
    </p>
    <p>
      Ground round bacon pig ribeye biltong capicola jerky prosciutto sirloin. Hamburger turducken corned beef leberkas andouille, shoulder pork shank strip steak biltong flank meatball pancetta chicken.
    </p>
  </div>
</body>
</html>
style.scss
/* Write your SCSS code below. */

5 Answers

Hi Richard,

I recommend watching Sass Functions again to see how Hampton creates a function.

The important thing to remember about Sass functions is to always include a return statement. Here is an example that might help you get started.

@function areaRectangle($length, $width) {
  @return $length * $width;
}
Erwin Meesters
Erwin Meesters
15,088 Points

Try this:

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

Hi thanks for the replies. I managed to solve it but seem to be stuck on another challenge now, taken me so long it timed out on the 4th challenge and now I need to start again. Really struggling with this section of the track. It seems that the challenges don't really resemble the tutorials as much as I need them to.

Which challenge are you stuck on? Sass Functions only has 3 tasks.

I am stuck on the interpolating objectives now. I cheated and found some of the answers online but timed out and couldnt find them again. It starts with saying "create a scope......." He doesnt even mention scope in the video. I am right at the end of the track and am losing my focus

Creating a scope on an element is jargon for creating a new CSS rule for an element. Scope actually refers to the curly braces { } which defines the visibility of its content.

For example,

Open a scope on an <ul> with the ID menu.

ul#menu {
  /* in the scope of the ul#menu element */
}

I agree with you that it could have been worded differently, and that he doesn't mention scope in the video. Hopefully this helped clarify the topic, allowing you to pass the challenge and move on.

Sass can be tricky, especially when also new to CSS. If you find yourself stuck again, don't hesitate to make a new forum post - more eyes will see it, getting you faster help. Also, the official documentation can be helpful when you know what you're looking for. Like, how to setup a @for loop.

Cheers

I managed to get through the last few challenges by pasting the questions to google and cheating. It was either that or not move on. I am happy with everything else on the track and have learnt alot. I am starting the web development track now but going over the sections I have already done again just as a refresh