Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import scss file error #3036

Closed
maskletter opened this issue Jul 6, 2018 · 4 comments
Closed

Import scss file error #3036

maskletter opened this issue Jul 6, 2018 · 4 comments

Comments

@maskletter
Copy link

  • angular v6.0.3

  • angular/cli v6.0.8

  • @material/top-app-bar v0.37.0

ERROR in ./node_modules/@material/top-app-bar/mdc-top-app-bar.scss Module build failed: undefined ^ File to import not found or unreadable: @material/elevation/mixins. in G:\angular5\material-angular\node_modules\@material\top-app-bar\mdc-top-app-bar.scss (line 17, column 1)

Can't be used together?

@maskletter
Copy link
Author

qq 20180706101025

@maskletter
Copy link
Author

qq 20180706101456

@williamernest
Copy link
Contributor

@maskletter Thanks for filing this issue. First, you have to update your angular.json (formerly angular-cli.json) to use the node_modules as an includePaths for Sass. You can do this by adding the following block to your angular.json file in the project.architect.build.options section.

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

Then, you want to create your own scss file to import the top app bar into (so you can add your own custom styles to the top app bar using our mixins).

Here's a few reference links to help.
https://github.com/angular/angular-cli/blob/5b1668f9ba39175e0f57fe23df6672ec40c3b745/docs/documentation/stories/global-styles.md

angular/angular-cli#10473

Here's an example repo
https://github.com/williamernest/mdc-web-angular-example

You might want to consider using the open source Angular MDC lib if you just want to build an app using our components.
https://github.com/trimox/angular-mdc-web

@maskletter
Copy link
Author

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants