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 Creating a Color Palette

What does Scope mean?

the Challenge question is: Open a scope for <a> tags and make their color 5% lighter than the standard red.
What does the word scope mean? Have not heard this before or seen it a video. I did a search and found the answer, but it seems strange to use the word "scope" for the word "rule".

1 Answer

Erik McClintock
Erik McClintock
45,783 Points

Dale,

"Scope", when used in this regard, is referring to an area where the binding or defining of certain information will be applied and considered valid, and it will not bleed out into other areas. This simply means that, if we set the value of the color property inside a declaration of the "a" tag, then the value of that color property is only applied within that "scope", which in this case, would be all anchor tags. This allows us the freedom to adjust the same property (or properties) elsewhere, as you're aware. The term "scope" just helps to reiterate the principal that the value assigned to the color property in any given block is "scoped" to that particular block.

a { /* the "a" tag that we've selected is the "scope" of the rules applied within */
    color: lighten( red, 5% ); /* only applies within this particular scope */
}

p { /* the "p" tag that we've selected is the "scope" of the rules applied within */
    color: red; /* only applies within this particular scope */
}

Many terms are used to refer to the areas where you'll target properties in your CSS files, ranging from scope to rule to block to selector to tag, etc.

Hope this helps to clarify a bit!

Erik