fix(desktop): gate composer CJK fonts on UI language

PingFang/YaHei are installed on every Mac/Windows machine, so a CJK-first
stack restyled Latin composer text for all users. Scope the stacks to
:lang(zh|zh-hant|ja), which the i18n provider stamps on <html>.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Hermes Agent
2026-09-25 17:04:57 -05:00
committed by brooklyn!
parent 7393dd560f
commit b93c915fab

View File

@@ -1676,9 +1676,21 @@ body.guest-pointer-lock :is(webview, iframe) {
[data-slot='composer-rich-input'] {
unicode-bidi: plaintext;
text-align: start;
/* CJK fonts handle full-width punctuation (,。?!…—) before Latin fallback */
font-family: "PingFang SC", "PingFang TC", "PingFang HK", "Microsoft YaHei",
"Noto Sans CJK SC", "Noto Sans CJK TC", var(--dt-font-sans);
}
/* Keyed on the UI language, not installed fonts: PingFang/YaHei ship on every
Mac/Windows box and would restyle Latin text for everyone. CJK-first is what
makes shared codepoints (…—“”) render full-width. */
[data-slot='composer-rich-input']:lang(zh) {
font-family: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', var(--dt-font-sans);
}
[data-slot='composer-rich-input']:lang(zh-hant) {
font-family: 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans CJK TC', var(--dt-font-sans);
}
[data-slot='composer-rich-input']:lang(ja) {
font-family: 'Hiragino Sans', 'Yu Gothic UI', 'Noto Sans CJK JP', var(--dt-font-sans);
}
/* Appearance → Text direction. An explicit RTL/LTR choice stamps dir on the