Change size of mat-icon-button

前端 未结 8 1336
隐瞒了意图╮
隐瞒了意图╮ 2021-02-05 04:36

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

8条回答
  •  一向
    一向 (楼主)
    2021-02-05 05:02

    Many answers unnecessarily complicated... Here is what worked for me using Angular 9:

    Assuming you want your icon to be 40x40:

    HTML:

    
    

    CSS:

    .mat-icon {
        height: 40px;
        width: 40px;
        font-size: 40px;
        line-height: 40px; // DO NOT FORGET IT !
    }
    

    No need ng-deep or !important.

提交回复
热议问题