Recall & Review
beginner
What does the
@extend directive do in Sass?The @extend directive lets one CSS selector inherit the styles of another selector. It helps avoid repeating the same styles.
Click to reveal answer
beginner
How does
@extend affect the compiled CSS output?It combines selectors that share styles into one rule, reducing duplication and making CSS smaller and easier to maintain.
Click to reveal answer
intermediate
Can
@extend be used with placeholder selectors? What are placeholders?Yes. Placeholders start with % and are not output alone in CSS. They are meant to be extended by other selectors.
Click to reveal answer
intermediate
What happens if you
@extend a selector inside a nested rule?The extended styles are merged respecting the nesting, so the output CSS keeps the correct hierarchy and specificity.
Click to reveal answer
advanced
Why should you be careful when using
@extend with very generic selectors?Because it can cause unexpected style merging and large combined selectors, making CSS harder to debug and maintain.
Click to reveal answer
What symbol is used to define a placeholder selector in Sass?
✗ Incorrect
Placeholder selectors start with % and are meant to be extended but do not output CSS on their own.
What is the main benefit of using
@extend in Sass?✗ Incorrect
@extend helps combine selectors sharing styles, reducing repetition in the CSS output.If you
@extend a selector inside a nested rule, what happens?✗ Incorrect
Sass merges extended selectors respecting nesting to keep correct CSS structure.
Which of these is a risk when overusing
@extend with generic selectors?✗ Incorrect
Using
@extend with generic selectors can create large combined selectors that are hard to debug.Can
@extend be used to inherit styles from multiple selectors at once?✗ Incorrect
You can extend multiple selectors by listing them separated by commas in
@extend.Explain how the
@extend directive works in Sass and why it is useful.Think about how sharing styles can save writing the same CSS again.
You got /4 concepts.
Describe potential problems when using
@extend with very generic selectors and how to avoid them.Consider what happens if many selectors get combined unexpectedly.
You got /4 concepts.