How to include Roboto font in webpack build for Material UI?

后端 未结 5 559
眼角桃花
眼角桃花 2021-01-30 03:45

For a progressive web app based on Material UI (React) and built with Webpack, how do I properly include Roboto font(s) so that the app does not depend

5条回答
  •  旧时难觅i
    2021-01-30 04:22

    If you do use Angular, where import 'typeface-roboto' is not ideal and easy, you may do it a little different than suggested here.

    First, install this nice npm package as described by others:

    npm install typeface-roboto --save
    

    Then just add this to your angular.json:

    "styles": [
      "node_modules/typeface-roboto/index.css",
      [...],
      "src/styles.css"
    ],
    

提交回复
热议问题