Skip to content

fix(banner): keep the site banner to two lines on phones - #369

Merged
yasinmiran merged 3 commits into
mainfrom
fix/banner-mobile
Nov 17, 2026
Merged

yasinmiran merged 3 commits into
mainfrom
fix/banner-mobile

Conversation

@yasinmiran

@yasinmiran yasinmiran commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

What

On a phone the site banner put its label, its message and its button on three separate rows. With the workshop announcement that made it 117px tall on an iPhone 13 Pro, and the fixed navigation sits right under it.

Below the lg breakpoint the label, message and link now run on as one piece of text, left-aligned beside the close button:

Width Before After
320px 137px 93px
390px (iPhone 13 Pro) 117px 71px
640px 129px 71px
768px 79px 57px
1024px and up 57px 57px (unchanged)
  • Phones (under 640px): the link shows as an arrow at the end of the message, and the whole text block is its tap target. Screen readers still get "Read more" plus the message as the link's name.
  • 640px to 1023px: the same run of text, with "Read more" spelled out and underlined.
  • 1024px and up: the centred row with the white button, as before.

Links written inside the message itself stay tappable above the stretched banner link.

A second commit loosens the compact layout: more space between the lines, more padding above and below, and a little more distance between the label, the text and the arrow. A first, tighter version was 58px at 390px wide; this one is 71px and still two lines. Below 382px wide the message takes three lines.

A third commit fixes what a review of the first two found: the link's tap area dropped to about 20px tall whenever the text fit on one line (tablets, short messages) and is now never under 44px; a long unbroken word ran under the close button and now wraps; the arrow sat slightly high on phones; and a desktop banner long enough to wrap had lost its row gap.

Testing

  • Measured in headless Chrome with real viewport emulation at 320, 375, 390, 430, 640, 768, 1024 and 1440px, plus 640x360 (a 1280x720 screen at 200% zoom): banner height, no horizontal scroll, close button 44x44 below 1024px, a tap on the message opens the link, a tap on the close button closes, and the navigation sits directly under the banner.
  • Looked at screenshots at 320, 390 and 768px, and at the event page (where the banner has no link) at 390px.
  • pnpm build (0 errors), pnpm test (49 tests), pnpm test:slugs, pnpm test:pages (186 pages).
  • Not tested on a real iPhone, only in Chrome's emulation. The lines are evened out with text-wrap: balance (Safari 17.5 and later); older Safari breaks them greedily, which changes where the lines break but not how many there are.

On a phone the label, the message and the button each took their own row, so the workshop banner was 117px tall at 390px wide and, with the fixed navigation under it, pinned a large part of a small or zoomed screen.

Below the lg breakpoint the label, message and link now run on as one piece of text. On a phone the link shows as an arrow and the whole text block is its tap target; from 640px the "Read more" text is back, and from lg the centred row with the button is unchanged. The banner is 58px at 390px wide and 77px at 320px.
Copilot AI balanced review requested due to automatic review settings November 17, 2026 15:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

…edges

The compact layout was tight. The lines now sit further apart, the banner has more padding above and below, and the label and arrow stand a little further from the text. It stays two lines at 390px wide: 72px tall, against 117px before the compact layout.
When the text fits on one line, as on a tablet or with a short message, the link's tap area was only as tall as the text, about 20px, against 44px before. It now never drops under 44px. A long unbroken word or address ran under the close button and made it untappable; it wraps now.

On a phone the arrow sat a few pixels above the middle of its line. On desktop a banner long enough to wrap had lost the gap between its rows and broke its lines differently; both are back to how they were. A link written inside the message gets its own padded tap area, so a near miss no longer opens the banner's link.
@yasinmiran
yasinmiran merged commit 58f6a70 into main Nov 17, 2026
1 check passed
@yasinmiran
yasinmiran deleted the fix/banner-mobile branch November 17, 2026 17:06
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.

2 participants