-
Notifications
You must be signed in to change notification settings - Fork 81
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
Add font-family fallback and optimize font loading #36
Add font-family fallback and optimize font loading #36
Conversation
Thank you for this, may I ask you how you selected the fonts in "font-body"? Also, would failing to load Literata fallback on the second, and so on? |
Optimized font loading by adding `font-display: swap`. Additionally, moved font-family values into CSS variables.
@tomfran ah, I made an error of using the font stack I was testing out on an example site instead of using something to fallback for Literata. Will update the PR.
Yes, it will fallback to the first font available in the stack and based on the usage of |
d65347e
to
ac1f38d
Compare
@@ -12,6 +12,9 @@ | |||
--header-menu-top-gap: 1rem; | |||
|
|||
/* Typography */ | |||
--font-body: 'Literata', Georgia, Cambria, 'Noto Serif', 'Droif Serif', ui-serif, serif; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tomfran this should be a more reasonable fallback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll have a look at soon as I have a laptop on my hands, thank you for changing it :)
I just realized that the menu was using monospace instead of Monaspace, I added a small font size to bring back some consistency in the size, as I saw my personal website changed quite a lot. I liked better the old monospace font there, completely missed it was another font 😅 |
@tomfran ah, I thought that was a typo (pun intended). btw |
Yeah it's better to use Monaspace everywhere, at least this was the intention. |
Add font-family fallback and optimize font loading
Add font-family fallback and optimize font loading
Optimized font loading by adding
font-display: swap
. Additionally, moved font-family values into CSS variables.