I’m attempting to change the fontsize of mat-checkbox’s label. Nothing I seem to attempt works as it’s consistently being overriden by the component’s default styles:
- !important
- ::ng-deep
- Setting global style in styles.scss
<mat-checkbox [(ngModel)]="reportOption.AllSelected" *ngIf="reportOption.SelectAll" (change)="onSelectAllChange($event, reportOption)" style="margin-left:5px;" class="custom-checkbox">Select All</mat-checkbox>
2
Answers
This was how I was able to get it to work:
What I did in my global stylesheet was something like below (extracted from my real code, assuming I have
<body class="my-app">...</body>
) and written in scss. I overwrite styles of classes defined in Angular Material, some of them related to checkbox I demonstrate here: