To change the color of mat-button-toggle
, apply color to it and make sure it stays within the mat-button-toggle-group
mat-button-toggle-group {
background-color: orange;
mat-button-toggle {
color: blue;
}
}
If you want to style .mat-button-toggle-label-content
, keep in mind that it requires breaking the encapsulation of styles.
Component styles are contained within the component, making them inaccessible from outside. To apply styles externally, you'll need to override them as shown below:
Important: Avoid using /deep/ as it is deprecated. Instead, follow the recommended approach mentioned above. For more information, refer to Component Styles documentation
mat-button-toggle-group {
background-color: orange;
/deep/ .mat-button-toggle-label-content {
color: blue;
}
}