hoomi
hoomi

Reputation: 139

Vuepress adding a font

I have add in the index.styl the following:

body {
   font-family: "Nunito-SemiBold", Helvetica, san-serif
}

But when building and deploying on the server, the fond doesn't show.

I tried even to put it on the root directory (the same as index.html).

Ideas?

Upvotes: 0

Views: 714

Answers (1)

Tarik
Tarik

Reputation: 475

In my case I added Plex font after downloading it to theme/assets/fonts after that I created other stylus file to define font like below:

fonts.styl

 @font-face
   font-family 'IBM Plex Sans'
   font-style normal
   src url('~@theme/assets/fonts/IBM_Plex_Sans/IBMPlexSans-Regular.ttf')

index.styl

/**
 * Custom Styles here.
 *
 * ref:https//v1.vuepress.vuejs.org/config/#index-styl
 */
@require 'fonts'
    
    *
      font-family 'IBM Plex Sans' !important

enter image description here

Upvotes: 1

Related Questions