1 | initial version |
To add a custom button color in Angular Material design, follow these steps:
MatButtonModule
from the @angular/material
package by adding the following code at the top of your file:import { MatButtonModule } from '@angular/material/button';
styles.scss
file by adding the following code:@import '~@angular/material/theming';
$custom-theme: mat-light-theme($color: (
primary: yourColor,
));
@include angular-material-theme($custom-theme);
yourColor
with the color you want to use for the button.color
attribute to yourColor
.<button mat-button color="yourColor">Custom button color</button>