ionic change default font

后端 未结 6 1073
-上瘾入骨i
-上瘾入骨i 2021-02-12 11:52

I know this question is asked and answered before in the links below. I want to change the default font without having to add to every css.

Things I have tried:

6条回答
  •  醉话见心
    2021-02-12 12:36

    The correct solution for Ionic 2 should be to change the $font-family-base variable and its friends. That's the way Ionic is made to do it. It gives you more control (like having different fonts per platform), and it avoids the !important keyword, which is always a good thing.

    Using Ionic 3.3, go to your variables.scss and find the section "Shared variables". Add these lines:

    $font-family-base: 'MyFont';
    $font-family-ios-base: 'MyFont';
    $font-family-md-base: 'MyFont';
    $font-family-wp-base: 'MyFont';
    

提交回复
热议问题