Easy way to change the font to local file via CSS #66
-
Hi, i am wondering if there is a way to change the font family for the Headings and the Paragraph to locally hosted fonts. I already copied the two fonts to static/fonts/ but now I don't know how to import them into my custom.css. Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hello @stamyx , to replace the font you should do 2 things:
.
├── assets
│ └── css
│ └── custom.css
...
└─── static
└── fonts
└─── font.ttf
@font-face {
font-family: font;
src: url('/fonts/font.ttf');
}
html {
font-family: font;
} After your suggestion I've also added these instructions to the docs |
Beta Was this translation helpful? Give feedback.
-
Hi @nunocoracao! I think it doesn't work that way if one builds the theme CSS from source. For some reason, Is there any difference with custom font setting in such case? |
Beta Was this translation helpful? Give feedback.
Hello @stamyx , to replace the font you should do 2 things:
static
folder as you've done, I would also place it within a folder calledfonts
.custom.css
file so that you can override the stylesheet, final structure will look like this:. ├── assets │ └── css │ └── custom.css ... └─── static └── fonts └─── font.ttf
custom.css
and apply it to the elements you wish (example below does it forhtml
):After your suggestion I've also added these instructions to the docs