w3c / w3c/csswg-drafts

[css-text-4] Way to only hyphenate when word is broken in “emergency situations”?

Open
#4,600 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

css-text-4 i18n-tracker
Dominant language
Bikeshed
Stars
4.9k
Forks
816
PR merge metrics
PR metrics pending

Description

https://www.w3.org/TR/css-text-4/#hyphenation

Sometimes, the best way to handle overlong words is overflow-wrap: break-word. Unfortunately, by default it breaks a word as soon as possible, instead of the intelligent break positions of hyphens.

Setting hyphens: auto; does hyphenate breaks from overflow-wrap, but it also breaks and hyphenates words that don’t need it:

A ragged-right paragraph with multiple consecutive lines broken at each end.

(from dassur.ma/things/when-workers/. I have to pop open devtools to disable hyphens whenever I read his blog.)

I find hyphenation difficult and distracting to read, but I appreciate their signal that a word has been broken when it’s necessary.

I would love a value like hyphens: overflow that doesn’t needlessly hyphenate, but intelligently breaks words when necessary.

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.

Research direction

Start with the CSS Text 4 hyphenation section linked in the issue, then compare the reported behavior of overflow-wrap: break-word and hyphens: auto using the linked example. Done means reaching and documenting a CSS Working Group resolution for conditional hyphenation, including the behavior of any proposed value.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.