GCoe
GCoe

Reputation: 885

Angular material theme install

I'm beginning with Angular material.After install dependencies I can use the components but cant't see any colors.

First I've installed the theme at styles.css :

@import "~@angular/material/prebuilt-themes/purple-green.css";

But witth no results.

Then I used a reference at index.html :

  <link href="node_modules/@angular/material/prebuilt-themes/indigo-pink.css" rel="stylesheet">

No results too. All remains black and white.

Any ideas ?

Upvotes: 0

Views: 8536

Answers (3)

Philipp Kief
Philipp Kief

Reputation: 8603

What happens if you set a color attribute to your component like e.g.

<button md-raised-button color="primary">Click me!</button>

This should normally result in a colored button:

enter image description here

Upvotes: 1

Masoud Esmaeilian
Masoud Esmaeilian

Reputation: 72

please tell more about your project, which version of angular? surely you are doing wrong, if it's angular cli project, you need to add in in .angular-cli.json, you should see a property named styles, add it there

Upvotes: 2

FAISAL
FAISAL

Reputation: 34673

In your .angular-cli.json add the following in your styles entry:

styles: [
    "../node_modules/@angular/material/prebuilt-themes/indigo-pink.css"
]

then run ng build in your terminal window.

Upvotes: 2

Related Questions