Skip to content

Prefer sans-serif to system-ui in default fonts #4946

@tats-u

Description

@tats-u

Is your feature request related to a problem? Please describe.

system-ui does not guarantees that the mapped font is optimized for the page (content) language.
For instance, if the language of your OS is Japanese and you visit a simplified Chinese page (e.g. https://cn.vite.dev/), a Japanese font (Yu Gothic UI in Japanese Windows) is allocated at least in Windows:

Image

It looks ugly especially as Chinese text.

  • The font family is not unified. It lacks the glyph "", so a different (native Chinese) font is used there and the weight differs than the other han characters.
  • The shape of and are incorrect. They are Japanese forms ( and ). Note: their code points are identical!

If you remove system-ui, you can get the intended glyph (look at and ) even in a Japanese OS:

Image

A similar (vice versa) bug will occur if you visit a Japanese page that abuses system-ui with a Chinese OS.

Also, Yu Gothic UI is not optimized for long text, which VitePress is designed to serve. It is overly optimized for cramming labels or relatively short descriptions into narrow spaces.
Microsoft YaHei UI seems to have narrower line height than the normal Microsoft YaHei.

Condition for font locale mismatch:

  • The page abuses system-ui
  • The language of the page is one of CJK but different from that of OS
  • The language of the page is not simplified Chinese or that of OS is not CJK

Describe the solution you'd like

Use sans-serif instead of system-ui. If both exists, If both are used, eliminate system-ui. ui-sans-serif is dedicated to macOS as for now.

If you do not like the Latin glyphs in common fonts mapped to system-ui, add Segoe UI (Variable) or Apple system fonts.

It guarantees that it is the most readable font for the reader and matched to the OS language.

system-ui is nothing but Apple's self-indulgence.

Describe alternatives you've considered

Stick to system-ui

It can look crappy for readers, contrary to Apple's intentions.

Additional context

Split out from #4927

https://infinnie.github.io/blog/2017/systemui.html
https://heistak.github.io/your-code-displays-japanese-wrong/

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    themeRelated to the theme

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions