Is there any elegant way to use lighter/darker variants of either primary or accent colors with buttons in angular 2 material without recreating whole styling by hand?
If you use sass you can import material theming into your scss file and target material colors like so:
app.component.scss
@import '~@angular/material/theming';
.buttonPrimary {
background-color: mat-color($mat-purple, 200);
}
.buttonAccent {
background-color: mat-color($mat-amber, A200);
}
app.component.html
<button md-raised-button class="buttonPrimary">primary</button>
<button md-raised-button class="buttonAccent">accent</button>