Published on 1 min read
Setting Up a CSS Preprocessor in Angular CLI
Angular CLI has built-in support for the popular CSS preprocessors: Sass/SCSS and Less. Respectively, these formats are supported: sass, scss and less (Stylus was supported as well, until its support was removed in Angular 12).
In this post, we’re going to use scss as an example.
Starting a New Project
In case the project hasn’t been generated yet, we can pick one of the supported CSS preprocessors through the interactive prompt of ng new, or set it explicitly while generating the project:
ng new sample-project --style=scss
Updating an Existing Project
In case the project was already generated, but we want to set a preprocessor - we can change the default:
ng config schematics.@schematics/angular:component.style scss
From now on, whenever we generate a new component, Angular CLI creates the style file with an appropriate format.
All that’s left is to adjust all styles in the project to the new format (actual file format and styleUrl metadata).
Note: Don’t forget to adjust the global styles file in angular.json as well - under architect.build.options.styles.
You’re welcome to share:
Join My Newsletter
Get new posts directly to your inbox.
Comments are powered by DisqusDetails
Loading comments activates Disqus, which collects information as a third-party service.
The site owner has no access to or control over the information collected by Disqus.
Related Posts

How to Sync a Design System with Claude Design
18 min read
Syncing React components into Claude Design with /design-sync: what the mirror holds, how it's verified and a step-by-step example with shadcn/ui, Tailwind v4 and Storybook.

ECMAScript - Introducing Deferred Module Evaluation with import defer
8 min read
Introducing the “import defer” proposal, a new ECMAScript import form that loads and links modules eagerly while deferring their evaluation until a namespace property is first accessed - currently at stage 3 in the TC39 process.

ECMAScript - Introducing BigInt Primitive in ES2020 (ES11)
5 min read
BigInt in ES2020 (ES11) - a new primitive for arbitrarily large integers, with its operators, comparisons and limits.