vxh.viet
2/20/2019 - 12:59 PM

Add mixins from Library

Add mixins from Library

SOURCE

The example library is angular-mdc-web.

In order to use the custom mixins from the library add this to angular.json file in the project.architect.build.options section:

...
"stylePreprocessorOptions": {
     "includePaths": [
           "node_modules"
      ]
}
...

Then in your component scss, find the path to the mixins file in the node_modules and import it as follow:

// path from node_modules for mdc-text-field
@import "@angular-mdc/theme/scss/textfield/mdc-text-field";

// use like this:
mdc-text-field {
  @include mdc-text-field-textarea-fill-color(red);
}