Overview - Avoiding selector bloat from @extend
What is it?
In Sass, @extend lets you reuse styles by making one selector inherit another's styles. However, using @extend carelessly can create very long CSS selectors, called selector bloat, which slows down browsers and makes code hard to maintain. Avoiding selector bloat means writing Sass that keeps CSS selectors simple and efficient while still sharing styles.
Why it matters
Without avoiding selector bloat, your website's CSS grows large and complex, making pages slower to load and harder to fix. This can frustrate users and developers alike. Keeping selectors clean helps websites run faster and makes future changes easier and safer.
Where it fits
Before this, you should understand basic Sass syntax and how @extend works. After this, you can learn about alternative Sass features like mixins and functions for sharing styles without bloating selectors.