The default color depends on the theme you @import .
But corner material also provides a way to customize the theme or customize components such as changing the color of the check box .
The steps to do this are as follows:
1.) Import the _theming.scss file
@import "../node_modules/@angular/material/theming";
2.) Indicate the color of the accent, i.e. the color of the flag you want to apply as shown below: -
// customising of the mat-checkbox accordiing Theme. i am using pink indigo theme bydefault so here I am changing the checkbox color from pink to grey. $candy-app-primary: mat-palette($mat-indigo); // here I am specify the grey instead of Pink. $candy-app-accent: mat-palette($mat-grey, 600, 500, 900); $candy-app-warn: mat-palette($mat-red); // Create the theme object (a Sass map containing all of the palettes). $candy-app-theme: mat-light-theme($candy-app-primary, $candy-app-accent, $candy-app-warn); // here I am only calling checkbox mixin because i only want to change the checkbox color @include mat-checkbox-theme($candy-app-theme);
Hope this helps.
Sunny goel
source share