How can I change mat-icon-button size? My icon has 24px now and I would like to increase that value to 48px. I use mat-icon as a button content. I also noticed that mat-icon-but
Override the font size of mat-icon using either of the options. (I changed md- to mat- for the newest AM version)
::ng-deep
to reach that class deep in the host. The width and the height should be also set to adjust the backdrop size proportionally.
HTML:
CSS
::ng-deep .mat-icon{
height:48px !important;
width:48px !important;
font-size:48px !important;
}
Check out the Demo
::ng-deep
, use ViewEncapsulation.None
(but use sparingly):
Class:
import {ViewEncapsulation} from '@angular/core';
@Component({
encapsulation: ViewEncapsulation.None
})
Then you can style directly from the component stylesheet.
CSS:
.mat-icon{
height:48px !important;
width:48px !important;
font-size:48px !important;
}
Demo
styles.css
.mat-icon{
height:48px !important;
width:48px !important;
font-size:48px !important;
}
Demo
HTML:
Demo