2Compiling Sass into CSS

We’ve introduced the idea that Sass is an advanced version of CSS. As a matter of fact, any valid CSS is valid Sass. Sass just adds features on top of CSS—it’s a kind of meta language. Unfortunately at this point, no browsers support Sass files directly, so we have to convert from Sass into CSS first.

The basic gist is that we write some Sass and then we compile—or convert—Sass into CSS. How do we compile Sass into CSS? Well, you did it in the last step of Task 1, Installing Sass, but we didn’t use any of the extra powers of Sass, so the results were pretty similar.

Let’s run through how we can convert a Sass file into a CSS file again in a lot more detail than we did in the last task.

First, we need to create a Sass ...

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