O'Reilly logo

Pragmatic Guide to Sass by Michael Lintorn Catlin, Hampton Catlin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

12Importing

When you’re developing, it’s often useful to have many smaller style sheets rather than one huge one. This can be a pain for web performance. If you have five style sheets on a particular page, it can make the page loading times much slower because each style sheet needs a separate request to load.

Importing is a process by which a lot of files are turned into a few files. Sass has a neat little trick whereby the smaller style sheets are imported into the larger one as it is compiled into CSS. All you need to type is @import, followed by the name of the Sass file you want to import. You can mix Original Sass and SCSS at will with imports—it’s all the same. Just say @import “sub_page”; and you’re done!

If you don’t want a Sass file ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required