Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Try out @danielroe's Fontaine: https://github.com/unjs/fontaine
If it works out I'd be happy to contribute Docusaurus usage docs to the project as per unjs/fontaine#7
Baseline
Here's my blog in mobile mode right now (to be clear; this is live - the baseline):
I've added Fontaine
I'm using Docusaurus and I'm kind of guessing what implementation should be; I could be have a borked approach.
When I browse to https://thankful-sky-0bfc7e803-305.westeurope.1.azurestaticapps.net/ it doesn't seem to work. Probably doing something wrong. It looks like this:
According to the Lighthouse report:
Why do I think it doesn't work?
Well essentially it's the word width thing. On the first line we either see:
Fallback font: "Bicep: Static Web Apps" [four words on one line]
OR
Custom font (Poppins): "Bicep: Static Web" [three words on one line]
I would expect the fallback font to also be displaying "Bicep: Static Web"; fitting the same amount on a single line.
So maybe I'm doing something wrong.
Things I could be doing wrong
resolvePath: (id) => '../fonts/' + id,
. Not sure if this is correct, I copy pasted from custom.css. There you'll see code like this:src: url('../fonts/Poppins-Regular.ttf');
- which made me thinkI needed to specify../fonts/
for each font. Is this right? Dunno. No errors in the console that I can see. Unsure how to debug.