【Angular】Angular Materialでフォントを変更する

AngularMaterialでフォントを変更する

 

 

実装

 

index.html

<head>
 <meta charset="utf-8">
 <title>Sample</title>
 <base href="/">
 <meta name="viewport" content="width=device-width, initial-scale=1">
 <link rel="icon" type="image/x-icon" href="favicon.ico">
 <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500&display=swap" rel="stylesheet">
 <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  <!-- 変更するフォントを追加 -->
 <link href="https://fonts.googleapis.com/earlyaccess/roundedmplus1c.css" rel="stylesheet">
</head>

 

style.css

html, body { height: 100%; }
// Angular Materialの設定
body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; }

// 全てのセレクタにフォントを適用
* {
 font-family: 'Rounded Mplus 1c';
}