Repository navigation
Fix share button text wrapping on mobile - #146
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review. WalkthroughThe Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~2 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The Share label is kept on one line to address the reported mobile wrapping. No concrete regression is established, so no actionable merge-blocking risk is supported. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
05dd3ef to
6ce5ffa
Compare
|
Thanks so much for this fix, @bst1n! I rebased your branch onto the latest main and rebuilt the CSS to clear the conflicts with the built files. Your commit is unchanged otherwise. Merging now. Really appreciate the contribution! 🙌 |
Problem
On narrow viewports (mobile), the Share button's label can wrap mid-word inside the
.gh-meta-shareflex container.In post.hbs, the
.gh-meta-sharecontainer isdisplay: flex; justify-content: space-between;with the author/date/reading-time block on the left and the.gh-button-shareon the right. With noflex-shrinkorwhite-spacerule on the button, narrow screens (and longer translated labels — e.g. French "Partager", German "Teilen", etc.) cause the button to be squeezed by its sibling and its text to wrap mid-word inside the pill.Screenshot of the bug, French locale, iPhone Safari, on a post using
show_post_metadata:Solution
Two CSS properties on
.gh-button-share:flex-shrink: 0keeps the button at its intrinsic width so the sibling meta block absorbs the available width and wraps naturally (which it already does cleanly thanks to.gh-article-meta-contentbeing flex/wrap-friendly).white-space: nowrapis belt-and-braces for any future translation longer than the pill's intrinsic width.No HTML change, no breakpoint change, no specificity bump. Desktop layout is unaffected because the button was never wrapping there in the first place.
Alternatives considered
partials/icons/). Cleaner visually on very narrow screens but requires a new icon partial, a JS-less media-query swap, and a discussion on whether to keep the text for a11y. Happy to switch to this approach if preferred — let me know..gh-meta-sharevertically below ~600px. Heavier visual change for what's a minor edge case, and the meta + button row reads well side-by-side once the button stops wrapping.Files
assets/css/screen.css— 2 lines added on.gh-button-shareassets/built/screen.css+.map— rebuilt viagulp buildto match the convention from Add share button #134Browser support
Standard CSS, no new properties. Works everywhere
.gh-button-shareitself works.