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 trialChristopher Borchert
14,814 PointsWhat 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
26,676 PointsHi 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
Christopher Borchert
14,814 PointsChristopher Borchert
14,814 PointsVery clear response. Thank you!
Chris Shaw
26,676 PointsChris Shaw
26,676 PointsNo problem, if you ever find yourself stuck I find that the Sass reference can normally help otherwise the function reference does wonders too.