-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Improve monospaced font on Chrome Android #812
Conversation
This pull request is automatically deployed with Now. |
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'm a fan of this. I do wonder which OS/device combos were even using Courier
, but I agree that falling back to the OS default is probably better in those cases.
@broccolini do you want to weigh in on this before we include it in the next patch release? |
I slightly changed this PR: - $mono-font: ... Courier, monospace;
+ $mono-font: ... monospace, Courier; So now, in the unlikely case (and I would consider it a browser bug) that @broccolini would that be ok? It now should be even less risky. |
After chatting with Shawn, I removed Courier again as a last fallback. It really shouldn't be needed and every browser should support |
See explanation in primer/css#812
This improves the monospaced font on Chrome Android.
Problem
It seems that Chrome on Android skips the first 4 fonts from Primer's mono font stack and uses
Courier
. Which is very thin and probably not meant for smaller text sizes. Interestingly Firefox skipsCourier
and uses the fallbackmonospace
font.Fix
By switching the order, Chrome now also uses the browser's fallback
monospace
font before usingCourier
. This should translate to:monospace
->Monaco
monospace
->Droid Sans Mono
Alternatives
We could add
Monaco
andDroid Sans Mono
to the font stack. Which would have the same result. But maybe it's ok to leave it up to the browser to pick the "best" monospaced font. In case we don't like it whenever it gets changed, we can override it again./cc @primer/ds-core