Skip to content

Instantly share code, notes, and snippets.

@vxhviet
Last active February 20, 2019 13:11
Show Gist options
  • Save vxhviet/e6c9f7e05fd58010f44decd4405fbda7 to your computer and use it in GitHub Desktop.
Save vxhviet/e6c9f7e05fd58010f44decd4405fbda7 to your computer and use it in GitHub Desktop.

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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment