coderef

text-spacing-trimLimited availability

The text-spacing-trim CSS property controls spacing around CJK characters, avoiding excessive whitespace when using full-width punctuation characters.

Not yet supported in all major browsers — check the table and provide a fallback.

Browser support

DesktopChrome
1–122Not supported
123+Supportedsince Mar 19, 2024
Current: 155
Edge
12–122Not supported
123+Supportedsince Mar 22, 2024
Current: 154
Firefox
✕Not supportedup to 157
Current: 157
Safari
✕Not supportedup to 27
Current: 27
MobileChrome Android
18–122Not supported
123+Supportedsince Mar 19, 2024
Current: 155
Firefox Android
✕Not supportedup to 157
Current: 157
Safari iOS
✕Not supportedup to 27
Current: 27

How to use

Not supported in Firefox, Safari, Firefox Android, Safari iOS. Use feature detection below and provide a fallback (or a polyfill) for those browsers.

Example

Full syntax and examples are on MDN: text-spacing-trim.

Feature detection

CSS · check before using
@supports (text-spacing-trim: initial) {
  /* styles that rely on text-spacing-trim */
}

/* or in JavaScript */
if (CSS.supports("text-spacing-trim", "initial")) {
  // use it
}

Sub-features

Support for each part of the feature (5). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
text-spacing-trim123123✕✕123✕✕
text-spacing-trim.normal123123✕✕123✕✕
text-spacing-trim.space-all123123✕✕123✕✕
text-spacing-trim.space-first123123✕✕123✕✕
text-spacing-trim.trim-start123123✕✕123✕✕