Skip to content

fix(web): let long inline code wrap so posts don't scroll sideways on phones - #4610

Merged
bpamiri merged 1 commit into
developfrom
peter/inline-code-wrap
Oct 15, 2026
Merged

bpamiri merged 1 commit into
developfrom
peter/inline-code-wrap

Conversation

@bpamiri

@bpamiri bpamiri commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

At phone width, a long inline <code> span overflowed the .prose column and made the whole page scroll sideways by about 26-30px. An example is application.wheels.protectedControllerMethods in a paragraph. This adds one rule to web/packages/ui/src/styles/base.css:

.prose :not(pre) > code { overflow-wrap: anywhere; }

Inline code now breaks inside the column. Fenced blocks (pre > code) are excluded, so they keep white-space: pre and scroll horizontally inside their own box. No other code styling changes.

Fixes #4609

Testing (blog build)

  • 390px and 1280px: no page-level horizontal scroll on routing-resources (previously 26px) or seven other code-heavy posts.
  • Fenced code blocks: still scroll; no wrapping inside pre.
  • Inline code that fits: unchanged; only over-long tokens wrap.
  • Table cells: inline code now wraps too, so code-heavy markdown tables fit a phone screen. A long token can break mid-word there; that's readable, and better than the page scrolling.

Starlight (guides, api) has its own inline-code rule; the matching change is tracked in #4608.

🤖 Generated with Claude Code

… phones

A long inline <code> span (an identifier or URL) overflowed the .prose
column at phone width and pushed the whole page about 26-30px wide.
.prose :not(pre) > code now uses overflow-wrap: anywhere, so inline code
breaks inside the column. Fenced blocks (pre > code) are excluded and
keep scrolling horizontally inside their own box.

Fixes #4609

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Peter Amiri <peter@alurium.com>
@bpamiri
bpamiri merged commit a149b85 into develop Oct 15, 2026
22 checks passed
@bpamiri
bpamiri deleted the peter/inline-code-wrap branch October 15, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

web/blog: long inline code makes posts scroll sideways at phone width

1 participant