0
0
SASSmarkup~5 mins

Extend limitations and gotchas in SASS - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a key limitation of the @extend directive in Sass?
It can only extend selectors that appear earlier in the stylesheet or in imported files. Extending selectors defined later will not work.
Click to reveal answer
intermediate
Why can @extend cause unexpected CSS output?
Because it merges selectors, it can create very long, complex selectors that affect more elements than intended, leading to styling bugs.
Click to reveal answer
intermediate
Can @extend be used inside media queries?
Yes, but the extended selectors must also be inside the same media query. Otherwise, the styles won’t be applied as expected.
Click to reveal answer
beginner
What happens if you try to @extend a placeholder selector that does not exist?
Sass will throw an error because it cannot find the selector to extend.
Click to reveal answer
beginner
How does @extend differ from mixins in Sass?
@extend merges selectors to share styles, while mixins copy properties into the selector. Mixins do not create combined selectors.
Click to reveal answer
What does @extend do in Sass?
AImports external stylesheets
BCopies properties into a selector
CMerges selectors to share styles
DDefines variables
Which of these is a limitation of @extend?
AIt can extend selectors defined later in the file
BIt can create very long combined selectors
CIt copies properties instead of merging selectors
DIt works only with variables
What happens if you @extend a selector inside a media query but the original selector is outside?
AStyles are ignored
BStyles apply normally
CSass throws an error
DStyles are duplicated
If you try to @extend a non-existent placeholder selector, what happens?
ASass throws an error
BIt creates an empty selector
CSass ignores it
DIt creates a warning but compiles
Which is true about @extend compared to mixins?
ABoth merge selectors
B<code>@extend</code> copies properties, mixins merge selectors
CBoth copy properties
D<code>@extend</code> merges selectors, mixins copy properties
Explain the main limitations and common gotchas when using @extend in Sass.
Think about order, selector merging, media queries, and errors.
You got /4 concepts.
    Compare @extend and mixins in Sass and describe when you might choose one over the other.
    Focus on how styles are shared or copied.
    You got /5 concepts.