share-card: scale title font by length (fix overflow on long titles) - #1275
Merged
Conversation
…itles) Screenshot from user: rpc-capabilities leaderboard template renders the 101-char title 'Fastest free public RPC for Ethereum, BNB, Polygon and 23 more chains (plus Solana and Polkadot)' at fontSize=50 which wraps to 4 lines and overlaps the leaderboard rows underneath. Same crash on snapshot (fontSize=48 title overflows into the time-series chart). Fix: scaledTitleSize(base, title) helper ramps font size down for long titles. <=60 chars stays at base, >100 chars shrinks to 50% base. Keeps short titles at the original design size and only touches long ones. Applied to 4 templates: ranking 44/56 base leaderboard 50 base snapshot 48 base compare 36 base Headline stays untouched (title font is already 18 px because the template features the winner's big number, not the bench title). No layout math change, no CSS variable, no schema change. Just the one font-size call per template swapped for the helper.
This was referenced Jul 17, 2026
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.
Long bench titles (rpc-capabilities: 101 chars) at fontSize=48-50 wrap to 4 lines and overlap the leaderboard/chart underneath. Adds scaledTitleSize(base, title) helper with a linear ramp: <=60 chars stays at base, >100 chars shrinks to 50%. Applied to ranking / leaderboard / snapshot / compare. Headline untouched (title font already 18px).