Let\'s say I need to use the mat-primary
color as a background of a div
using a css/sass class, how do i reference it? I thought something like:
You have to first import the theme with
@import '~@angular/material/prebuilt-themes/deeppurple-amber.css';
Then you have to define a mixin like
@mixin primary-color($theme) {
$primary: map-get($theme, primary);
//Then you can use `mat-color` to get the `primary` color
.a-class {
background-color: mat-color($primary);
}
}
Reference Link: Documentation