Using SASS with the Angular CLI

There are a few ways to use SASS with the Angular CLI. The first and easiest option is to declare it when you create the CLI project, which will add a styles.scss file to the /src/app/ directory.

ng new sassy-project --style=sass

Or you can update an existing project to use the SCSS extension.

ng set defaults.styleExt scss

You can also edit the angular-cli.json file directly and add the below code.

{
  "defaults": {
    "styleExt": "scss"
  }
}

Other supported style extenstions are LESS and Stylus. See the official CLI documentation for more information. If you need more information on getting started with the Angular CLI, check out our other posting on the topic.

Add new comment