After my research, I found out only these things.
All material icon is Google fonts, so you can change the size and stroke by using CSS properties font-size
and font-weight
, but there are some limitations.
If you are using Angular Material (mat-icon).
In that way, if you open index.html
you will find there:
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
that font-family
provides only font-weight: normal (400)
, so you can't change its weight to less than 400.
So the way to use, for ex: font-weight: 200
, is refuse to use <mat-icon></mat-icon>
and replace it with material icons https://fonts.google.com/icons.
All that you need is to replace in index.html
link to fonts you want to use and provide a font-weight parameter wght@200
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght@200" />
And then in your component change implementation to
<span class="material-symbols-outlined">invert_colors</span>
So in that way of implementation, you will have a thinner icon that you can resize with the font-size
property.
Also, you can pass more parameters to the font link, more details here:
https://developers.google.com/fonts/docs/material_symbols
And in case when you register a custom svg then inside mat-icon
will be your svg, then you can try to add stroke
and stroke-width
properties.
<mat-icon style="stroke-width: 0.1; stroke: aqua" [svgIcon]="'custom-svg'"></mat-icon>