Easy way to create accent and other colored buttons in Angular Material v19 is simply to create another theme with your specific colors in a specific CSS selector. E.g.
.accent {
@include mat.theme(
(
color: mat.$magenta-palette,
)
);
}
.warn {
@include mat.theme(
(
color: mat.$red-palette,
)
);
}
And then just simply apply the class to your button when you want.
<button class="accent" mat-flat-button>Accent button</button>
<button class="warn" mat-flat-button>Warn button</button>
I discussed all of this in a recent video, if you'd like more details.