I have a file with my theme setup
@import '~@angular/material/theming';
@include mat-core();
$app-primary: mat-palette($mat-cyan, 600);
$app-accent: mat-palette($mat-indigo, 900);
$app-warn: mat-palette($mat-red);
$app-theme: mat-light-theme($app-primary, $app-accent, $app-warn);
@include angular-material-theme($app-theme);
And this works fine. However, now I need extra color in one component and I decided to make another theme for that specific component.
@import "~@angular/material/theming";
$radio-app-primary: mat-palette($mat-cyan, 600);
$radio-app-accent: mat-palette($mat-yellow, 900);
$radio-app-warn: mat-palette($mat-deep-purple);
$radio-app-theme: mat-light-theme($radio-app-primary, $radio-app-accent, $radio-app-warn);
@include angular-material-theme($radio-app-theme);
But this doesn't seem to affect my radio group in any way.
This is my component's html
<mat-radio-group [formControl]="control">
<div class="row">
<div class="col-6" *ngFor="let option of radioOptions; let i = index">
<mat-radio-button [value]="option.value" [color]="i == 1 ? 'accent' : null">
<mat-form-field class="w-100">
<input type="text" matInput [placeholder]="option.label" [readonly]="true"
style="pointer-events: none" [value]="option.string">
</mat-form-field>
</mat-radio-button>
</div>
</div>
</mat-radio-group>
I tried to seek styles from my custom theme and I found something but that doesn't seem to apply to component's inner mat
components. They still use global theme colors.