Skip to content

fix(style): stop pages scrolling sideways on narrow screens - #253

Merged
annejan merged 1 commit into
masterfrom
fix-mobile-overflow
Aug 14, 2026
Merged

fix(style): stop pages scrolling sideways on narrow screens#253
annejan merged 1 commit into
masterfrom
fix-mobile-overflow

Conversation

@annejan

@annejan annejan commented Aug 14, 2026

Copy link
Copy Markdown
Member

Refs #119.

The screenshot in #119 is the front page: the 80s stamp logo pushed the cover
wider than the phone. That part was fixed in 2060291 and 3869337. Rather
than close the issue on that alone, I measured the whole site.

Method

Headless Chrome over CDP, every page in sitemap.xml (177), at 320, 375, 414
and 768 px, comparing documentElement.scrollWidth with clientWidth and
listing the elements that stick out.

Before: 177 pages overflowed at 320 px, 7 at 375 px, 4 at 414 px, 1 at
768 px. Worst case /docs/badges/campzone-2019/, 243 px too wide on a 320 px
screen and still 54 px too wide at 768 px.

Causes and fixes

Three rules in assets/scss/_variables_project.scss:

  1. Unbreakable words. A long URL used as link text, or a heading holding a
    line of code, cannot wrap. That is what widened campzone-2019, the
    Hackerhotel 2020 PuTTY page, the Hackerhotel 2024 and MCH2022
    software-development pages and /contact/.
    .td-content { overflow-wrap: break-word; }. Code blocks are unaffected:
    pre does not wrap, so there is nothing to break there.
  2. The brand logo. assets/icons/logo.svg declares width="80mm", about
    302 px, and the navbar margins add 20 px — wider than a 320 px screen, worth
    1–2 px of scroll on every page.
    max-width: calc(100vw - 2.5rem) on the navbar svg. That only bites below
    roughly 340 px, so the logo is unchanged on every other screen (checked at
    1280 px).
  3. Swagger UI on /docs/hatchery/api/ and /docs/hatchery/api_mch2022/
    lays itself out wider than the content column.
    #docsy_swagger_ui { overflow-x: auto; }, so the widget scrolls instead
    of the page.

Result

The same sweep after the change: 177 pages × 4 widths, 0 overflowing.

Also checked visually at 320 and 375 px (front page, campzone-2019, the PuTTY
page) and at 1280 px for the desktop layout.

🤖 Generated with Claude Code

https://claude.ai/code/session_0142DuVFXpWnjeQhZzT3N3nC

Refs #119.

A sweep of all 177 pages at 320, 375, 414 and 768 px, measuring
documentElement.scrollWidth against clientWidth in headless Chrome, found 177
pages overflowing at 320 px and five that still overflowed at 414 px. Three
causes, three rules:

- A long URL used as link text is one unbreakable word, and so is a heading
  that contains a line of code. /docs/badges/campzone-2019/ carried the page
  520 px wide on a 375 px screen this way, and was still 54 px too wide at
  768 px. `overflow-wrap: break-word` on .td-content lets those break. It does
  not touch code blocks: `pre` does not wrap, so there is nothing to break.
- The brand logo declares its size in millimetres, 80mm ≈ 302 px, which with
  the navbar padding is wider than a 320 px screen. The max-width uses
  calc(100vw - 2.5rem), so it only takes effect below about 340 px and the
  logo is untouched everywhere else.
- Swagger UI on the two Hatchery API pages lays itself out wider than the
  content column. It now scrolls inside its own box instead of taking the page
  with it.

The same sweep after the change: 177 pages, four widths, zero overflowing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0142DuVFXpWnjeQhZzT3N3nC
@annejan
annejan merged commit 84eae73 into master Aug 14, 2026
1 check passed
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.

1 participant