How to change md-icon size in Material

2019-02-07 17:29发布

This question comes from the material2 github repo https://github.com/angular/material2/issues/4422#issuecomment-300309224

I still have problems to style a material component that is wrapped in a custom component.

I have a <logo> component that contains <md-icon svgIcon="logo"></md-icon>

adding

:host { 
   .mat-icon {
    width: 100px;
    height: 100px;
    font-size: 56px;
  }
}

Will not apply to the material component inside my custom component

7条回答
何必那么认真
2楼-- · 2019-02-07 18:30

I think the problem is caused by inlining the svg without viewBox - preventing all resizing attempts.

Seems to me the alternative is using the iconfont directly:

<i class="material-icons" style="font-size: 40px">face</i>
查看更多
登录 后发表回答