feat(theme-classic): add text-autospace for improved CJK readability#11933
feat(theme-classic): add text-autospace for improved CJK readability#11933fffzzau wants to merge 1 commit intofacebook:mainfrom
Conversation
|
Hi @fffzzau! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
tats-u
left a comment
There was a problem hiding this comment.
You should not hurry up and send a PR without achieving an approval from the maintainer.
| html[data-red-border] div#__docusaurus { | ||
| border: red solid thick; | ||
| } | ||
|
|
| content: 'theme-layout'; | ||
| } | ||
|
|
||
| html { |
There was a problem hiding this comment.
Equivalent:
| html { | |
| :root { |
| } | ||
| pre, code, kbd, samp { | ||
| text-autospace: no-autospace; | ||
| } No newline at end of file |
| "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e", | ||
| "dependencies": { | ||
| "chevrotain": "11.0.3" | ||
| } |
This PR introduces the text-autospace CSS property to the global layout which has the issue #11928 . Currently, when Latin characters (English, numbers) are placed immediately next to CJK (Chinese, Japanese, Korean) characters, the lack of spacing can make the text feel cramped and reduce readability.
I hereby setting text-autospace: normal, the browser automatically injects a small amount of visual "breathing room" between these different script types, following standard typographic principles for multi-script documents. I have also disabled this for code-related elements (pre, code, etc.) to ensure technical strings remain precise.
Test Plan
I verified this change by running the Docusaurus development server locally and inspecting the rendering of mixed-script strings.
Manual Inspection:
Used the browser developer tools to toggle the text-autospace property on and off.
Visual Confirmation:
Verified that strings like 5分 and curlを使用 show the correct typographic spacing when the property is active.