According to the guideline in the Google Material website we have to use material icons in _i _ tag.
the question is how to add the icons as font-awesome. something like :
Class="material-icons face"
instead of
<i class="material-icons"> face </i>
There's an easier way than the accepted answer. I got inspiration for this from the plugin css-toolip, which utilises the attr()
css function (surprisingly has high browser adoption).
While attr() is supported for effectively all browsers for the content property... https://caniuse.com/#search=css%20attr
<span class="material-icons" data-icon="face"></span>
.material-icons:after {
content: attr(data-icon);
}
This means that you don't have to add css for each icon that you want to use.
Yes,you can add the material icons as classes using the after pseudo elements.check out the fiddle
<span class="material-icons face"></span>
.face {
position:relative;
display:inline-block;
}
.face:after {
content: "face";
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With