Skip to content

Stop the home page hero from being squeezed on phones - #24

Open
obenland wants to merge 1 commit into
trunkfrom
fix/mobile-hero-width
Open

obenland wants to merge 1 commit into
trunkfrom
fix/mobile-hero-width

Conversation

@obenland

@obenland obenland commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Fixes https://meta.trac.wordpress.org/ticket/6522
Fixes #3

On phones narrower than 414px, the home page hero is squeezed into a narrow column next to the menu button and its heading breaks mid-word.

Below 768px, the parallax hero rule .page-template-template-homepage:not(.has-post-thumbnail) .site-main > .sph-hero:first-child { margin-top: -4.2358em } pulls the hero up into the header, beside the right-floated menu toggle. Because the hero has overflow: hidden, it shrinks to fit next to the button instead of running under it: 238px wide on a 375px screen. From 414px up there's no room beside the button, so the hero drops below it at full width, which is why only phones break.

This resets that margin to 0 below 768px, and bumps the theme version to 1.0.1 so the stylesheet's ?ver= changes and browsers pick up the new CSS.

Testing

  1. Open https://doaction.org/ at 375px wide.
  2. Before: the hero is a narrow column beside the menu button and the heading breaks mid-word.
  3. After: the hero sits below the header at full width and the heading wraps by word.
  4. At 414px and wider nothing changes (checked at 414, 600, 767, 768, 1024, 1280 and 1440px). 320, 360 and 390px are fixed too.

Screenshots

Live https://doaction.org/ at 375px, with the patched stylesheet swapped in for “after”.

Before After
doaction.org home at 375px before: the hero is a narrow column beside the menu button doaction.org home at 375px after: the hero spans the screen below the header

At 320px the word “communities” is still wider than the box at the current font size; that's left for a separate change.

Props upadalavipul.

🤖 Generated with Claude Code

Below about 414px, the parallax hero's negative top margin pulls it up
next to the header's floated menu toggle. Because the hero is
`overflow: hidden`, it then shrinks to fit beside that float, so the
heading breaks mid-word and the text runs a word or two per line.

Drop the negative top margin below 768px, where the header has no bottom
margin for it to cancel anyway. The hero then starts below the header at
full width; wider layouts are unchanged. Bump the theme version so the
stylesheet URL changes.

See https://meta.trac.wordpress.org/ticket/6522.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings November 14, 2026 11:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

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.

Is the layout collapsed on a mobile device when the width is less than a certain screen width?

2 participants