1

I have external SASS file like external.scss and which has below content

@import "core/colors";

This is included into application like adding below in angular.json file

"styles": [
          "path/external.scss",
            "styles.scss"
        ],

I try to access some variables present in colors.scss file in my application but it says variable not found. I have to import the colors.scss file again inside my styles.scss file to detect the variable. Is there no way to prevent addition into styles.scss file.

Hacker
  • 7,798
  • 19
  • 84
  • 154
  • In my case i have simply create `_vars.scss` and import in style.scss `@import "vars";` like that and in my `_vars.scss` code like `$BoxShadow: 0px 0px 12px rgba(0, 0, 0, 0.16);` and use in `style.scss` like `box-shadow: $BoxShadow`. – Abhishek Jan 22 '19 at 14:11

1 Answers1

0

I'd use the stylePreprocessorOptions and specify an array of paths inside includePaths.

Dzhavat Ushev
  • 725
  • 4
  • 13