Reputation: 73
I have imported the theme CSS to my style.css in my project as below, just like how it was stated on the Angular Material website.
@import '~@angular/material/prebuilt-themes/indigo-pink.css';
When I have it in dev mode, the styling works, however, when I build to production, the styling does not work.
Any ideas?
Upvotes: 4
Views: 2115
Reputation: 495
Add this line into the styles array in angular-cli.json :
"../node_modules/@angular/material/prebuilt-themes/indigo-pink.css"
Upvotes: 3
Reputation: 614
you can add
<link href="https://unpkg.com/@angular/material/prebuilt-themes/indigo-pink.css" rel="stylesheet">
in <head>
section of index.html
OR copy the folder prebuilt-themes from node-modules/@angular/material e.g. to your /assets folder, then @import "./assets/prebuilt-themes/indigo-pink.css"; in your css/scss file
Upvotes: 1