-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to overwrite the font? #52
Comments
I believe you have to change the theme code itself, yes. |
It's not that hard to change this, the theme would have to basically expose an extra switch. I would be glad to accept this as a contribution, e.g. a true by default switch to enable the Hack font (e.g. See https://github.com/pawroman/zola-theme-terminimal/blob/master/templates/macros/head.html#L22-L26 Or, an alternative approach -- wrap all the font styles in a named |
So I tried commenting out lines 22-26 completely but running |
This would probably work fine if we completely removed the fonts from the The It could look something like this: {%- if config.extra.use_full_hack_font %}
<link rel="stylesheet" href="{{ get_url(path="font-hack.css", trailing_slash=false) | safe }}">
{% else if config.extra.remove_hack_font %}
<!-- if remove_hack_font -> include no css file -->
{% else %}
<link rel="stylesheet" href="{{ get_url(path="font-hack-subset.css", trailing_slash=false) | safe }}">
{% endif -%} I think having the hack font be opt-out is better so as to not break everyone's blogs with the new update; you would have to change your config only to remove the font, otherwise everything should stay the same, hence the Let me know your thoughts! Edit: As a clarification, my github pages fonts folder does indeed not include my chosen font (FiraCode) as it is being loaded from a CDN instead. |
An update on this, I made the changes in my fork here and used it in my blog. Without changing anything:
Setting Is this something that would work for you as well? Maybe it's a good idea to check manually this time 😅, I've modified a bunch of files on my blog and there's some inconsistencies sometimes with the original. |
@goingforbrooke was working on adding a new/custom font. Maybe you could work on a "proper" way forward here together? I wouldn't oppose adding support for custom fonts to the theme. |
(See #69) |
Ok so, after spending the better part of the last half an hour trying to remember what I was even doing when making those changes, it turns out none of that was needed 😅 I have overwritten @font-face {
font-family: 'Fira Code';
font-style: normal;
font-weight: 400;
src: url("https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/ttf/FiraCode-Regular.ttf") format("woff");
}
@font-face {
font-family: 'Fira Code';
font-style: normal;
font-weight: 800;
src: url("https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/ttf/FiraCode-Bold.ttf") format("woff");
}
* {
font-family: 'Fira Code' !important;
} That is all you need to overwrite the font apparently. I am not sure what the issue was the first time I tried but after checking the network tab, it looks like the only font that gets downloaded is I guess we could mention this somewhere that in case you want to change the font you can do it this way? |
As @pawroman mentioned, I added Exo2 as the font for my blog, but I kept Hack as the monospace font. I don't plan to PR it, but it involved hijacking |
@goingforbrooke You still download the hack font 😅 That's probably the issue I was having, you need this I think: * {
font-family: 'Fira Code' !important;
} |
yup, @AntoniosBarotsis bc I want it for code chunks and stuff 👆🏻 |
I have currently added the following in my own
scss
file:Which works fine, but, the
hack
font is still downloaded, wasting some amount of time on the initial page load. Is that something I could change without making changes to the theme's code itself?Edit: I realize that this might be more of a zola question than a theme question but I couldn't find anything in the docs so I'm just asking here for now.
The text was updated successfully, but these errors were encountered: