0
0
SASSmarkup~5 mins

@extend directive in SASS - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
A%
B@
C#
D$
What is the main benefit of using @extend in Sass?
ATo repeat styles multiple times
BTo create animations
CTo add JavaScript functionality
DTo combine selectors and avoid style duplication
If you @extend a selector inside a nested rule, what happens?
AIt causes a syntax error
BThe styles are ignored
CThe styles are merged respecting nesting
DIt duplicates the styles
Which of these is a risk when overusing @extend with generic selectors?
AUnexpected style merging and complex selectors
BCSS file size increases
CJavaScript errors
DHTML validation errors
Can @extend be used to inherit styles from multiple selectors at once?
AOnly with placeholders
BYes, by listing selectors separated by commas
CNo, only one selector at a time
DOnly inside media queries
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.