2017-05-02 5 views
4

그냥 내가 ... 각도 재료에각도 재료 및 변경 글꼴

기본값은 Roboto로 인을 기본 글꼴을 변경하고 내가 다른 글꼴로 변경하는 방법을 찾을 수 있는지 궁금.

+0

이 문제를 봐 : https://github.com/angular/material2/issues/205 –

+0

재료 1 재료 2? – Edric

+0

자료 2 – Nav

답변

8

당신은 당신의 CSS 또는 SCSS* selector를 사용하려고 할 수 있습니다 : 또는

@import '[email protected]/material/theming'; 
$custom-typography: mat-typography-config(
    $font-family: 'Raleway' 
) 

@include angular-material-typography($custom-typography); 

:

* { 
    font-family: Raleway /*Replace with your custom font*/, sans-serif !important; 
    /*Add the !important to overwrite all elements*/ 
} 

편집 : 2.0.0-beta.7에서 시작, 지금은 타이포그래피를 사용자 정의 할 수있는 방법이 (2.0.0-beta.10 이상) :

// NOTE: From `2.0.0-beta.10`, you can now pass the typography via the mat-core() mixin: 
@import '[email protected]/material/theming'; 
$custom-typography: mat-typography-config(
    $font-family: 'Raleway' 
) 
@include mat-core($custom-typography); 

More info

+0

어디에서 스타일을 꾸미고 있습니까? "함수 mat-typography-config가 키워드 인수를 지원하지 않습니다." –

+0

@TonyScialo 업데이트 된 답변을 확인하십시오. – Edric

+0

ahhh 네, 테마 가져 오기를 추가해 주셔서 감사합니다. 감사! –