Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change theme in mat-icon for Outlined

I use <mat-icon>person</mat-icon> and have a result: enter image description here

I need the icon on theme Outlined: enter image description here

How do to do it ?

Importantion of the icons: <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

like image 900
Erick Zanetti Avatar asked Jul 13 '18 20:07

Erick Zanetti


People also ask

Can we change the color of mat icon?

You can change the color of the icons as per the requirement: Primary . Accent. Warn.

How do I change the icon size on my mat?

Since Angular Material uses 'Material Icons' Font-Family, the icon size depends on font-size. Therefore, if you want to modify the size of the icon then you change its font-size in your CSS file. You have to set the width and height too. After setting width and height to a value less that 24px, it looked awkward.

What should I import for mat icon?

import {MatIconModule} from '@angular/material/icon'; & link in your global index. html. Save this answer.


1 Answers

After dealing with the same issue I found that thankfully this now works...

First, add the outlined icons to your import using "|" to separate...

<link href="https://fonts.googleapis.com/icon?family=Material+Icons|Material+Icons+Outlined" rel="stylesheet">

Then add the class to your mat-icon...

<mat-icon class="material-icons-outlined">person</mat-icon>
like image 140
docb45 Avatar answered Sep 23 '22 09:09

docb45