vuejs / theme

VitePress theme for vuejs.org.
MIT License
245 stars 87 forks source link

fix: put all kinds of system monospace fonts before Courier New #114

Open haoqunjiang opened 2 days ago

haoqunjiang commented 2 days ago

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:

ui-monospace, 'SF Mono', 'SFMono-Regular', Menlo, Monaco, 'Cascadia Mono', Consolas, 'Liberation Mono', 'Noto Sans Mono', 'DejaVu Sans Mono', 'Roboto Mono', 'Courier New', monospace;

This puts all kinds of system monospace fonts before Courier New, with some personal preference.

I intentionally left out a few system monospace fonts:


As a reference:

GitHub's default:

ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace

Tailwind 3.4.13:

ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

StackExchange's design refresh in 2021: https://meta.stackexchange.com/questions/364048/we-are-switching-to-system-fonts-on-may-10-2021

Jinjiang commented 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?

haoqunjiang commented 1 day ago

Done! Added a link to my newly deployed blog