X Tutup
Skip to content

Document percentage letter-spacing and word-spacing values#43356

Merged
hamishwillee merged 9 commits intomdn:mainfrom
chrisdavidmills:letter-spacing-word-spacing-percentages
Mar 9, 2026
Merged

Document percentage letter-spacing and word-spacing values#43356
hamishwillee merged 9 commits intomdn:mainfrom
chrisdavidmills:letter-spacing-word-spacing-percentages

Conversation

@chrisdavidmills
Copy link
Contributor

Description

Chrome 145 adds support for percentage values on the letter-spacing and word-spacing properties.

See https://chromestatus.com/feature/5106867491700736.

This PR documents percentage values for these two properties, including descriptions and examples.

Motivation

Additional details

Related issues and pull requests

@chrisdavidmills chrisdavidmills requested a review from a team as a code owner March 6, 2026 20:11
@chrisdavidmills chrisdavidmills requested review from hamishwillee and removed request for a team March 6, 2026 20:11
@github-actions github-actions bot added Content:CSS Cascading Style Sheets docs size/m [PR only] 51-500 LoC changed labels Mar 6, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

Preview URLs (2 pages)

Flaws (4)

Found an unexpected or unresolvable flaw? Please report it here.

URL: /en-US/docs/Web/CSS/Reference/Properties/letter-spacing
Title: letter-spacing
Flaw count: 2

  • broken_links:
    • Link /en-US/docs/Web/CSS/length is a redirect
    • Link /en-US/docs/Web/CSS/percentage is a redirect

URL: /en-US/docs/Web/CSS/Reference/Properties/word-spacing
Title: word-spacing
Flaw count: 2

  • broken_links:
    • Link /en-US/docs/Web/CSS/length is a redirect
    • Link /en-US/docs/Web/CSS/percentage is a redirect

(comment last updated: 2026-03-09 18:19:45)

```

> <p lang="ar" dir="rtl">شسيبتنمك</p>
{{ EmbedLiveSample("i18n-sample", "100%", 60) }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we use a bigger font - the rendered text is almost invisible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added some hidden CSS to give it a bigger font-size and a little bit of margin at the start of the line.

BTW, I was originally going to show two examples, one with and one without letter-spacing, to demonstrate the problem, but letter-spacing seemed to make no difference, so I've just left it like this and used some hand-wavy language. I didn't want this little bit to derail the PR, as it's not the main point of it.


{{ EmbedLiveSample("live-sample___basic-usage", "100%", "100") }}

### Length and percentage word spacing comparison
Copy link
Collaborator

@hamishwillee hamishwillee Mar 9, 2026

Choose a reason for hiding this comment

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

So it is a matter of taste, but I prefer

Suggested change
### Length and percentage word spacing comparison
### Comparing word-spacing using length and percentage

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I already did this one, thanks!


{{ EmbedLiveSample("percentage-versus-length", "100%", 460) }}

First, note how the initial length word spacing value looks OK when applied to the larger font sizes, but it doesn't look good on the smaller font sizes. Now check the checkbox, and note how the percentage word spacing looks appropriate on all lines, as it scales with the font size. Percentage `word-spacing` values are useful for responsive text sizing.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Collaborator

@hamishwillee hamishwillee left a comment

Choose a reason for hiding this comment

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

Looks good. Just a few suggestions.

Copy link
Collaborator

@hamishwillee hamishwillee left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks very much.

@hamishwillee hamishwillee merged commit 21b9756 into mdn:main Mar 9, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:CSS Cascading Style Sheets docs size/m [PR only] 51-500 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

X Tutup