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 Variables, Mixins, Functions, and Placeholders Null Options and Arguments

Christopher Borchert
Christopher Borchert
14,814 Points

What does this mean? Although [directives] work with functions, a function is not required for using directives.

One of the questions on the quiz for the null options and arguments video was a true/false: "Directives add powerful logic with mixins. Although they work with functions, a function is not required for using directives with mixins."

I got the answer through brute force, but I don't understand the question. Could someone help me understand what is being asked? What is a directive, and what does the last part mean? Examples would be helpful.

1 Answer

Chris Shaw
Chris Shaw
26,676 Points

Hi Chris,

Directives are are things in Sass such as @if, @which, @each, @extend, @import etc, the question in a nutshell is asking you if you need a function to be able to use these directives which in Sass you don't need to as they can run anywhere within your Sass code.

I've placed the link to the Sass directives reference below but the basic thing you need to understand is that directives aren't dependent on another piece of code.

http://sass-lang.com/documentation/file.SASS_REFERENCE.html#directives

Chris Shaw
Chris Shaw
26,676 Points

No problem, if you ever find yourself stuck I find that the Sass reference can normally help otherwise the function reference does wonders too.