13Organizing Your Style Sheets

Back in Task 6, Importing Files, you learned about how to split up one giant Sass style sheet into multiple smaller style sheets. Especially on larger projects, though, figuring out exactly how to split up your style sheets can be a problem. Here, you’ll learn about some recommended ways to organize Sass.

Firstly, you should always have a base or main Sass file that contains all your imports. This gives you a nice central location where you can see all the other files you’re importing. No Sass other than @import should be present in this file.

The structure of your Sass files should be centered around three core folders: globals, components, and pages. The globals folder should contain all the Sass files with ...

Get Pragmatic Guide to Sass 3 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.