Open haoqunjiang opened 2 days ago
It looks really promising and good. And thanks for all the information. I just wonder whether it's a good idea to add the information into the code comments somehow. WDYT?
Done! Added a link to my newly deployed blog
There are multiple issues about Courier New being awful-looking on Linux:
Courier New is only readable under Windows because ClearType made a special case for it.
Therefore, it should never be one's first choice for monospace font. It should be put at the end of the list.
By the way, though Courier New is a proprietary font, it is available on Linux through Microsoft's Core Fonts for the Web. That's why Linux users might see it.
In this PR I propose we set the monospace font stack to:
This puts all kinds of system monospace fonts before Courier New, with some personal preference.
ui-monospace
is part of the CSS Fonts Module Level 4, and only available in Safari for now. The difference between it andmonospace
is thatui-monospace
aims to match the user's system monospace font, whilemonospace
is a generic monospace font that's defined by the browser. So it's better to put it first. It currently defaults to "SF Mono" on macOS.SFMono-Regular
is a hack before Apple made "SF Mono" available everywhere (It was only bundled with Xcode and Terminal on first launch).I intentionally left out a few system monospace fonts:
As a reference:
GitHub's default:
Tailwind 3.4.13:
StackExchange's design refresh in 2021: https://meta.stackexchange.com/questions/364048/we-are-switching-to-system-fonts-on-may-10-2021