Change default font in vuetify

前端 未结 13 1652
[愿得一人]
[愿得一人] 2020-12-14 16:19

I can\'t figure out how to change the default font in vuetify. I\'ve been looking for the right variable within ./node_modules/vuetify, but I can\'t locate it.

I\'d

13条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-14 16:38

    How I achieved it: (Vuetify 2+)

    1) Into your index.html, import your fonts.

    
    
    

    2) Inside /src, create a styles directory and a file named variables.scss inside it

    3) In that file, override some variables values:

    // Globals
    $body-font-family: 'MY_CUSTOM_FONT'; // Used on content
    $heading-font-family: 'Literata';    // Used on helpers classes
    

    Hope it helps someone.

    References:
    https://github.com/vuetifyjs/vuetify/issues/8169
    https://vuetifyjs.com/en/customization/sass-variables#example-variable-file

提交回复
热议问题