Skip to Content
Pragmatic Guide to Sass 3
book

Pragmatic Guide to Sass 3

by Hampton Lintorn Catlin, Michael Lintorn Catlin
July 2016
Intermediate to advanced
130 pages
2h 11m
English
Pragmatic Bookshelf
Content preview from Pragmatic Guide to Sass 3
33Understanding the Dangers of @extend

@extend is certainly powerful, but it can cause bloated output styles if not used carefully.

The example illustrates how just a couple of @extend uses can quickly spiral into some bloated output. All that’s happening is that the .small-icon class is extended onto two other areas. However, where it’s being extended is a little messy. There’s a couple of nested selectors, and they use commas. So Sass has to add all of those class permutations onto the original class, which leaves us with the bloated output you see.

This example shouldn’t suggest that you should never use @extend. Instead, it should illustrate that when choosing between a mixin or extend, you need to think about how you might be using it. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Jump Start Sass

Jump Start Sass

Hugo Giraudel, Miriam Suzanne
What Employees Want Most in Uncertain Times

What Employees Want Most in Uncertain Times

Kristine W. Powers, Jessica B.B. Diaz
Mastering Sass

Mastering Sass

Luke Watts

Publisher Resources

ISBN: 9781680502060Errata Page