Skip to content

Instantly share code, notes, and snippets.

@timbophillips
Created January 1, 2019 00:44
Show Gist options
  • Save timbophillips/455ac41659fddcd774c5550650665b66 to your computer and use it in GitHub Desktop.
Save timbophillips/455ac41659fddcd774c5550650665b66 to your computer and use it in GitHub Desktop.
host roboto font and material icons locally in angular app
//// npm install --save roboto-fontface material-icons
//// put the below stuff into src/styles.scss
// for npm roboto-fontface package (to load local files)
$roboto-font-path: "~roboto-fontface/fonts" !default;
@import "~roboto-fontface/css/roboto/sass/roboto-fontface";
// for npm material-icons package (to load local files)
$material-icons-font-path: '~material-icons/iconfont/';
@import '~material-icons/iconfont/material-icons.scss';
@germanjimenezz18
Copy link

Thank you :)

@leogout
Copy link

leogout commented May 6, 2025

As of today with angular 19 and Dart Sass 1.80.0 the @import keyword is deprecated. Here is what I had to do for it to work. Hope this helps :

// for npm roboto-fontface package (to load local files)
@use 'roboto-fontface/css/roboto/sass/roboto-fontface' with (
  $roboto-font-path: 'roboto-fontface/fonts'
);

// for npm material-icons package (to load local files)
@use 'material-icons/iconfont/material-icons.scss' with (
  $material-icons-font-path: 'material-icons/iconfont/'
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment