Categories
JavaScript Answers

How to host Material Icons offline with JavaScript?

Spread the love

Sometimes, we want to host Material Icons offline with JavaScript.

In this article, we’ll look at how to host Material Icons offline with JavaScript.

How to host Material Icons offline with JavaScript?

To host Material Icons offline with JavaScript, we can install the material-design-icons package.

To install it, we run

npm install material-design-icons --save

Then we import it in our CSS file with

@import '~material-design-icons/iconfont/material-icons.css';

And then we use it by writing

<i class="material-icons">face</i>

in our HTML code.

Conclusion

To host Material Icons offline with JavaScript, we can install the material-design-icons package.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *