Adding the Sass globbing plugin to import batches of partial files

For users who like to break their style sheets into numerous partial files, it is worth knowing that folders full of partials can be imported using a single line of code. For example, at present in the styles.scss file, we have the following imports listed:

@import "partials/variables";
@import "partials/mixins";
@import "partials/fonts";
@import "partials/normalize";
@import "partials/base";
@import "partials/placeholders";
@import "partials/bb-grid";
@import "partials/layout";
@import "partials/modules";
@import "partials/chapter-examples";

Instead, to import all of those partials in one go with Sass globbing, we could do this:

@import "partials/*";

However, before proceeding, know ...

Get Sass and Compass for Designers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.