Rehan Aziz
Rehan Aziz

Reputation: 107

Angular Material Theme import in Angular 2 not working in Webstorm

I am trying to import the built in themes of angular material 2 but web-storm is unable to the resolve the file path and find directory although my theme file is residing in that exact directory. i have tried different methods to import but all resulted in same issue. Here is how i am importing in my styles.scss file

@import '~@angular/material/prebuilt-themes/indigo-pink.css';

The IDE starts highlighting the path from material stating the problem.

This is the whole path of my theme file.

/media/rehan/New Volume/tic-tac-toe/node_modules/@angular/material/prebuilt-themes/indigo-pink.css

Upvotes: 2

Views: 8743

Answers (1)

Rehan Aziz
Rehan Aziz

Reputation: 107

As i am working with a Angular CLI based project in angular 2 so i simply added the theme file to the .angular-cli.json file under the styles object using the following path which may vary depending on where the angular material has been installed:

 "styles": [ "../node_modules/@angular/material/prebuilt-themes/indigo-pi‌​nk.css"]

Upvotes: 5

Related Questions