0
0
SASSmarkup~5 mins

Why extending reduces duplication in SASS - Quick Recap

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. This means you write styles once and reuse them, avoiding repetition.

Click to reveal answer
intermediate
How does @extend help reduce CSS file size?

By sharing styles between selectors, @extend combines selectors in the output CSS. This reduces repeated style blocks, making the file smaller and cleaner.

Click to reveal answer
beginner
Why is reducing duplication important in CSS?

Less duplication means easier maintenance, faster loading times, and fewer mistakes. When styles are written once and reused, updates are simpler and consistent.

Click to reveal answer
beginner
What is a real-life example of using @extend?

Imagine you have a button style. Instead of rewriting the same styles for a special button, you @extend the base button style and add only the differences.

Click to reveal answer
advanced
Can @extend cause any issues if used carelessly?

Yes. Extending too many selectors or extending complex selectors can create large combined selectors, which might be hard to debug or cause unexpected style clashes.

Click to reveal answer
What is the main benefit of using @extend in Sass?
AIt converts Sass to JavaScript
BIt creates new CSS properties
CIt deletes unused CSS selectors
DIt reuses styles to reduce duplication
How does @extend affect the generated CSS selectors?
AIt merges selectors that share styles
BIt duplicates selectors with same styles
CIt removes all selectors except one
DIt changes selectors to IDs
Which of these is a risk of overusing @extend?
ACreating very long combined selectors
BIncreasing CSS file size
CBreaking JavaScript code
DDisabling browser caching
Why is reducing duplication in CSS helpful?
AIncreases the number of CSS files
BMakes CSS harder to read
CMakes styles easier to maintain and faster to load
DPrevents using variables
Which Sass feature is best for sharing styles without copying code?
A@import
B@extend
C@function
D@mixin
Explain in your own words how @extend helps reduce duplication in Sass.
Think about writing styles once and using them many times.
You got /4 concepts.
    Describe a simple example where using @extend is better than copying styles.
    Imagine you have a normal button and a special button with mostly same styles.
    You got /4 concepts.