Repository navigation
fix(banner): keep the site banner to two lines on phones - #369
Merged
Merged
Conversation
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.
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
lgbreakpoint the label, message and link now run on as one piece of text, left-aligned beside the close button: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
pnpm build(0 errors),pnpm test(49 tests),pnpm test:slugs,pnpm test:pages(186 pages).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.