Change default font in vuetify

前端 未结 13 1598
[愿得一人]
[愿得一人] 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:58

    My solution in (latest) Nuxt:

    nuxt.config:

    head: {
    .......
    link: [
      {rel: 'icon', type: 'image/x-icon', href: '/favicon.ico'},
      {
        rel: 'stylesheet',
        href:'https://fonts.googleapis.com/css?family=Raleway:400|Roboto+Slab:200&display=swap'
      }
    ]
    },
    
    vuetify: {
    treeShake: true,
    customVariables: ['~/assets/variables.scss'],
    
    theme: {
      .....
      },
    }
    },
    

    variables.scss

    $body-font-family: Raleway, sans-serif;
    $heading-font-family: Roboto Slab, serif;
    
    @import '~vuetify/src/styles/styles.sass';
    

提交回复
热议问题