How to use SCSS with Angular

Using SCSS (Sass) in Angular applications provides powerful styling capabilities including variables, mixins, nesting, and modular CSS architecture for maintainable stylesheets. As the creator of CoreUI, a widely used open-source UI library, I’ve implemented SCSS extensively in Angular projects for theme systems, component styling, and responsive design patterns in enterprise applications. From my expertise, the most effective approach is to configure SCSS as the default stylesheet format in Angular CLI. This method provides seamless compilation, hot reloading, and access to advanced Sass features without additional build configuration.

Configure SCSS in Angular CLI and use advanced Sass features like variables and nesting.

$primary-color: #007bff;
$border-radius: 4px;

.button {
  background-color: $primary-color;
  border-radius: $border-radius;

  &:hover {
    background-color: darken($primary-color, 10%);
  }
}

SCSS extends CSS with variables using $ syntax, nesting selectors for cleaner organization, and functions like darken() for color manipulation. Angular CLI automatically compiles SCSS files when you specify --style=scss during project creation or configure it in angular.json. You can import SCSS files, use mixins for reusable styles, and leverage partial files starting with underscore for modular architecture. Global styles go in src/styles.scss, while component-specific styles use .scss extensions.

Best Practice Note:

This is the same approach we use in CoreUI Angular projects for maintainable theme systems and component styling. Create a _variables.scss file for global variables, use mixins for responsive breakpoints, and organize styles with partial files for better maintainability and team collaboration.


Speed up your responsive apps and websites with fully-featured, ready-to-use open-source admin panel templates—free to use and built for efficiency.


About the Author