overflow-wrap: anywhere splits words in narrow table columns #126

Closed
opened 2026-10-09 19:55:54 -04:00 by goddard · 1 comment
Collaborator

A global wrapping rule lets narrow table columns break words in the middle.

  • +layout.svelte:441-443 sets main { overflow-wrap: anywhere }. Unlike break-word, that lets cells shrink below a word's width.
  • On phones the Leaderboard's Rank column is 36 px wide (leaderboard/+page.svelte:1051), so its header reads "Ra / nk".

Screenshots

Before, Leaderboard at 390 px:
Before

After (mockup):
After (mockup)

Fix

  • Use overflow-wrap: break-word on main, and keep anywhere only for IDs and paths
A global wrapping rule lets narrow table columns break words in the middle. - `+layout.svelte:441-443` sets `main { overflow-wrap: anywhere }`. Unlike `break-word`, that lets cells shrink below a word's width. - On phones the Leaderboard's Rank column is 36 px wide (`leaderboard/+page.svelte:1051`), so its header reads "Ra / nk". **Screenshots** Before, Leaderboard at 390 px: ![Before](https://gitea.thewrightserver.net/attachments/664aee15-4893-4949-aec1-c80af78e3b0a) After (mockup): ![After (mockup)](https://gitea.thewrightserver.net/attachments/4184f74c-81f8-4ba5-90a0-b27b26e705b3) **Fix** - Use `overflow-wrap: break-word` on `main`, and keep `anywhere` only for IDs and paths
goddard added the
priority
low
type/ux
labels 2026-10-09 19:55:54 -04:00
josh was assigned by goddard 2026-10-09 19:55:54 -04:00
Author
Collaborator

Reviewed 253d47300c. The fix is done, so I'm closing this.

Checklist

  • break-word on main, anywhere for IDs and paths.
    • +layout.svelte:444 now sets overflow-wrap: break-word.
    • IDs and paths already set anywhere themselves (for example CopyValue.svelte:40 and ServerIdentity.svelte:26, in 58 files in all).
    • At 390 px, the Leaderboard's Rank header now renders on one line at 52 px. With the old rule injected, it splits over two lines at 44 px.

Review notes

  • To look for regressions, I loaded 31 pages (23 list pages and the first detail page of 8 of them) at 390 px and 768 px, once as committed and once with the old anywhere rule injected on main. No page overflows more horizontally with the new rule.
  • Run 861 passed on this commit.
Reviewed 253d47300cca250e867248695f3729151479a170. The fix is done, so I'm closing this. **Checklist** - [x] **`break-word` on `main`, `anywhere` for IDs and paths.** - `+layout.svelte:444` now sets `overflow-wrap: break-word`. - IDs and paths already set `anywhere` themselves (for example `CopyValue.svelte:40` and `ServerIdentity.svelte:26`, in 58 files in all). - At 390 px, the Leaderboard's Rank header now renders on one line at 52 px. With the old rule injected, it splits over two lines at 44 px. **Review notes** - To look for regressions, I loaded 31 pages (23 list pages and the first detail page of 8 of them) at 390 px and 768 px, once as committed and once with the old `anywhere` rule injected on `main`. No page overflows more horizontally with the new rule. - [Run 861](https://gitea.thewrightserver.net/josh/electric-cherry/actions/runs/861) passed on this commit.
Sign in to join this conversation.