Repository navigation
fix(foundation): hyphenate long heading words where the language allows - #1701
Merged
gregpriday merged 4 commits intoNov 28, 2026
Merged
Conversation
- headings ask for automatic hyphenation of words of 12 letters or more, broken at least 5 letters from either end (with Safari's prefixed limits for versions without hyphenate-limit-chars), so a long German compound in a display heading breaks at a syllable with a visible hyphen instead of at whatever letter reached the edge - the body's overflow-wrap: anywhere stays the last resort for a language the browser has no dictionary for - test the rule in both releases, and in a real browser the break, a hyphens: manual control and an 11-letter word that stays whole, skipping visibly where the browser has no German dictionary - refresh the Foundation pack digests
gregpriday
force-pushed
the
feature/issue-1472-break-long-localized-headings-at
branch
from
November 28, 2026 10:27
deaf16a to
e850432
Compare
Member
Author
|
CI's
|
…issue-1472-break-long-localized-headings-at # Conflicts: # resources/packs-dev/foundation-alt/pack.json # resources/packs.lock.json # resources/packs/foundation/pack.json
The test files are type-checked without the DOM library, so the probe's document and getComputedStyle calls go to the page as a string, as the other browser tests do.
gregpriday
deleted the
feature/issue-1472-break-long-localized-headings-at
branch
November 28, 2026 18:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Foundation's headings broke a word too long for its line (a German compound such as "Hochwasserschutzmaßnahmen" in the Split hero) at whatever letter reached the edge, with no hyphen ("Hochwassersch" / "utzmaßnahmen"). The theme's only rule for long words was
overflow-wrap: anywhereon the body. Headings now ask the browser to hyphenate long words where the page's language allows. The emergency break stays as the last resort, for languages the browser has no dictionary for.Resolves #1472
Changes
h1–h6rule in the base CSS of both committed releases (foundation,foundation-alt) addshyphens: auto(and-webkit-hyphens) withhyphenate-limit-chars: 12 5 5. Only words of 12 letters or more hyphenate, at least 5 letters in from either end, so a shorter word still moves to the next line whole. Older Safari ignoreshyphenate-limit-chars, so-webkit-hyphenate-limit-before/after: 5keep the same margins there.lang, which the export already declares. The Japanese, Chinese and Korean heading rules are unchanged and still govern those scripts.resources/packs.lock.jsoncarries the newpack.jsondigests. The private builder-components source needs the same change, or a refresh from the pinned commit will revert it.In Chromium at a 358 px column, the issue's heading now reads "Hochwasser-" / "schutzmaß-" / "nahmen für das" / "Mündungsge-" / "biet." Before, it read "Hochwassersch" / "utzmaßnahmen" / … / "Mündungsgebiet" / ".".
Testing
tests/unit/foundation-heading-hyphenation.test.ts. It checks the rule in both releases, and in Playwright Chromium checks the computedhyphensand that the word stays inside the heading. Where the browser has a German dictionary, it also checks three things: the long word breaks only at a German syllable at least 5 letters from either end (with emergency wrapping off), ahyphens: manualcontrol leaves the word unbroken, and the 11-letter "Wasserstand" stays whole although the browser alone splits it as "Wasser-stand". Those dictionary checks report a skip where the browser ships no German dictionary. All six browser checks failed before the change, and all pass on macOS Chromium with nothing skipped.committed-packs,theme-packs,pack-loader,packs-gate,pack-previews-render,foundation-html,foundation-surface-contrast,foundation-interactive-browser,foundation-text-link-arrow,collection-templatesanddata-table-print, all green. After the last rebase,contact-formandfoundation-field-message-languagealso ran, all green. That is 12 of 664 unit test files (the import-graph selector reaches none of them, since they readpack.jsonthroughfs).