How to change the color of a mat-button in Angular?

Asked

Viewed 904 times

0

How does it become possible to change the color of an angular mat-button? I’m using Theme Indigo-pink, and it has a pink Accent, I don’t think it matches, and I’d like to change to another color, but in css it doesn’t work.

1 answer

2


See if this can help:

CSS:

.mat-button.mat-blue {
   color: blue;
}

.mat-raised-button.mat-blue, .mat-flat-button.mat-blue{
   background-color: blue;
   color: white;
}

HTML:

<button mat-button color="blue">Custom Blue Button</button>

<button mat-raised-button color="blue">Custom Blue Button</button>

<button mat-flat-button color="blue">Custom Blue Button</button>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.