highlight

Angular2 File Size md-icon

How can I adjust icon size with relative font size in angular2?

<div style="font-size: 3em;">
<md-icon>highlight</md-icon>
Title
</div>
+4
source share
2 answers

In your CSS file, you can resize the md icon by changing the font size, height and width. For instance:

md-icon.size-45 {
    font-size: 45px;
    height: 45px;
    width: 45px;
}
+7
source

There are two ways to approach this.

You can influence the ligature:

<md-icon><h1>highlight</h1></md-icon>

This will resize the icon, but it will be affected by the styles set on the title elements (for example, font-weight). So, I would recommend resizing with CSS:

<md-icon style="font-size:24px">highlight<md-icon>

This will dramatically resize the icon. You can, of course, also add classes for this (which is even better!):

<md-icon class="large">highlight<md-icon>
-2
source

Source: https://habr.com/ru/post/1672129/


All Articles