How to import material icons as SVG?

1.2k Views Asked by At

I am currently creating an icon component in Angular. For this purpose, I am importing the material-icons library inside my css-file:

@import url("https://fonts.googleapis.com/icon?family=Material+Icons");

Now I have access to material icons, I can simply use them with the known syntax, e.g.:

<span class="material-icons">home</span>

All of this works fine as long as the size of my icons equals 24px. However, when resizing the icons, they appear blurry.

I was thinking that material icons are SVGs, and it says on this website that they are available as SVGs. Apparently, I have imported the PNGs and not the SVGs. Is there a way to import the SVGs using a CDN such as the Google fonts I have imported?

0

There are 0 best solutions below