w3c / w3c/csswg-drafts

[css-text] Phrase line breaking should fallback to normal line breaking if overflow

Open
#9,033 4 comments 1 reaction 1 assignee View on GitHub

@frivoal is already working on this.

Since Jun 19, 2026.

Closed Accepted by CSSWG Resolution Commenter Response Pending Needs Edits
Dominant language
Bikeshed
Stars
4.9k
Forks
816
PR merge metrics
PR metrics pending

Description

We've got a feedback that when a phrase can't fit in a line, it should fallback to normal line breaking.

For example:

<div style="width: 5em">こんにちは。</em>

This line overflows when the phrase engine computes "こんにちは" as a phrase.

Authors can prevent the overflow by:

div {
  word-break: phrase;  /* the keyword TBD */
  overflow-wrap: anywhere;
}

but this produces:

こんにちは
。

which breaks the Japanese line breaking rules not to break before the fullwidth period. From authors' point of view, this should break as below instead:

こんにち
は。

Since the exact algorithm to determine the phrase boundaries is UA-dependent, this could be either part of the spec or part of the UA's algorithm, whichever works for me but wanted to share the feedback.

@litherum @frivoal @fantasai

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.