JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › General Discussions › Use Material icons in Vue template › Reply To: Use Material icons in Vue template
January 27, 2020 at 1:40 pm
#100598
Hristofor
Member
Hi olaf@xso,
Add the following CSS to you CSS stylesheet and import it in your App.vue file:
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url(https://example.com/MaterialIcons-Regular.eot); /* For IE6-8 */
src: local('Material Icons'),
local('MaterialIcons-Regular'),
url(https://example.com/MaterialIcons-Regular.woff2) format('woff2'),
url(https://example.com/MaterialIcons-Regular.woff) format('woff'),
url(https://example.com/MaterialIcons-Regular.ttf) format('truetype');
}
.material-icons {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 24px; /* Preferred icon size */
display: inline-block;
line-height: 1;
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
white-space: nowrap;
direction: ltr;
/* Support for all WebKit browsers. */
-webkit-font-smoothing: antialiased;
/* Support for Safari and Chrome. */
text-rendering: optimizeLegibility;
/* Support for Firefox. */
-moz-osx-font-smoothing: grayscale;
/* Support for IE. */
font-feature-settings: 'liga';
}
If you don’t want to fetch the icons from the web and instead use yout localy downloaded files from NPM just replace the urls in the font-face with the path to the appropriate files in your local storage.
Best Regards,
Christopher
Smart HTML Elements Team
https://www.htmlelements.com