angular-cli/docs/documentation/stories/css-preprocessors.md
Ward Bell a237113aae docs: css-preprocessors wiki - inline styles must be in CSS.
Cannot write them in less, sass, or stylus
See issue #8472
2017-12-01 10:11:45 +00:00

902 B

CSS Preprocessor integration

Angular CLI supports all major CSS preprocessors:

To use these preprocessors simply add the file to your component's styleUrls:

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent {
  title = 'app works!';
}

When generating a new project you can also define which extension you want for style files:

ng new sassy-project --style=sass

Or set the default style on an existing project:

ng set defaults.styleExt scss

Style strings added to the @Component.styles array must be written in CSS because the CLI cannot apply a pre-processor to inline styles.