Skip to content

feat(theme-classic): add text-autospace for improved CJK readability#11933

Open
fffzzau wants to merge 1 commit intofacebook:mainfrom
fffzzau:main
Open

feat(theme-classic): add text-autospace for improved CJK readability#11933
fffzzau wants to merge 1 commit intofacebook:mainfrom
fffzzau:main

Conversation

@fffzzau
Copy link
Copy Markdown

@fffzzau fffzzau commented Apr 12, 2026

Screenshot 2026-04-12 135405 Screenshot 2026-04-12 135554 Screenshot 2026-04-12 135843

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.

@meta-cla
Copy link
Copy Markdown

meta-cla bot commented Apr 12, 2026

Hi @fffzzau!

Thank you for your pull request and welcome to our community.

Action Required

In 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.

Process

In 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 CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@socket-security
Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​docusaurus/​tsconfig@​3.9.21001005699100
Added@​docusaurus/​cssnano-preset@​3.9.21001006799100
Added@​docusaurus/​faster@​3.9.2991006795100
Added@​docusaurus/​utils-common@​3.9.21001006899100
Added@​docusaurus/​plugin-rsdoctor@​3.9.2751006999100
Updated@​swc/​html@​1.13.5 ⏵ 1.15.2499 +110069 +196 +3100
Added@​docusaurus/​plugin-google-tag-manager@​3.9.21001006999100
Added@​docusaurus/​module-type-aliases@​3.9.21001006999100
Added@​docusaurus/​plugin-google-analytics@​3.9.21001007099100
Added@​docusaurus/​plugin-svgr@​3.9.2991007099100
Added@​docusaurus/​preset-classic@​3.9.2991007099100
Added@​docusaurus/​plugin-google-gtag@​3.9.21001007099100
Added@​docusaurus/​babel@​3.9.2991007199100
Added@​docusaurus/​plugin-css-cascade-layers@​3.9.21001007199100
Updated@​types/​color@​3.0.6 ⏵ 3.0.71001007189100
Added@​docusaurus/​utils-validation@​3.9.21001007199100
Added@​docusaurus/​types@​3.9.2991007299100
Added@​docusaurus/​eslint-plugin@​3.9.2991007299100
Added@​docusaurus/​plugin-sitemap@​3.9.2991007299100
Added@​docusaurus/​bundler@​3.9.2981007299100
Added@​docusaurus/​plugin-content-pages@​3.9.2991007399100
Added@​docusaurus/​plugin-client-redirects@​3.9.2991007399100
Added@​docusaurus/​plugin-debug@​3.9.21001007399100
Updated@​ai-sdk/​react@​2.0.133 ⏵ 2.0.174981007398100
Added@​docusaurus/​plugin-pwa@​3.9.2911007397100
Updated@​types/​prismjs@​1.26.5 ⏵ 1.26.610010074 +181 -2100
Added@​docusaurus/​utils@​3.9.2971007599100
Updated@​types/​semver@​7.5.8 ⏵ 7.7.1100 +110075 +181100
Updated@​types/​micromatch@​4.0.9 ⏵ 4.0.101001007581100
Added@​docusaurus/​plugin-ideal-image@​3.9.2971007599100
Added@​docusaurus/​core@​3.9.2981007599100
Added@​docusaurus/​theme-search-algolia@​3.9.2991007599100
Updated@​types/​shelljs@​0.8.15 ⏵ 0.8.17100 +110075 +182100
See 32 more rows in the dashboard

View full report

@socket-security
Copy link
Copy Markdown

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.

Action Severity Alert  (click "▶" to expand/collapse)
Warn Critical
Critical CVE: Axios has a NO_PROXY Hostname Normalization Bypass Leads to SSRF

CVE: GHSA-3p68-rc4w-qgx5 Axios has a NO_PROXY Hostname Normalization Bypass Leads to SSRF (CRITICAL)

Affected versions: < 1.15.0

Patched version: 1.15.0

From: ?npm/@crowdin/crowdin-api-client@1.55.1npm/@argos-ci/playwright@2.0.0npm/@rsdoctor/rspack-plugin@0.4.13npm/@rsdoctor/webpack-plugin@0.4.13npm/axios@1.14.0

ℹ Read more on: This package | This alert | What is a critical CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known critical CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/axios@1.14.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Critical
Critical CVE: Axios has Unrestricted Cloud Metadata Exfiltration via Header Injection Chain

CVE: GHSA-fvcv-3m26-pcqx Axios has Unrestricted Cloud Metadata Exfiltration via Header Injection Chain (CRITICAL)

Affected versions: < 1.15.0

Patched version: 1.15.0

From: ?npm/@crowdin/crowdin-api-client@1.55.1npm/@argos-ci/playwright@2.0.0npm/@rsdoctor/rspack-plugin@0.4.13npm/@rsdoctor/webpack-plugin@0.4.13npm/axios@1.14.0

ℹ Read more on: This package | This alert | What is a critical CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known critical CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/axios@1.14.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@meta-cla
Copy link
Copy Markdown

meta-cla bot commented Apr 12, 2026

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@meta-cla meta-cla bot added the CLA Signed Signed Facebook CLA label Apr 12, 2026
Copy link
Copy Markdown
Contributor

@tats-u tats-u left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

content: 'theme-layout';
}

html {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Equivalent:

Suggested change
html {
:root {

}
pre, code, kbd, samp {
text-autospace: no-autospace;
} No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No final newline here

Comment on lines +140 to +143
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",
"dependencies": {
"chevrotain": "11.0.3"
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you add this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants