You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Board: keep the leaderboard title on one line at every width - #16
The public board's title, "GitHub Learn at Universe leaderboard", wrapped onto two lines. It could grow to 4.5rem (72 px), but the column it sits in is at most 64rem wide, and at that size the title is wider than the column.
Fix (leaderboard-service/public/board.css)
The header is a size container, and the h1 font size is min(5.2cqi, 4.5rem) with white-space: nowrap.
Measured in Chromium at weight 800, the title is up to 18.3 em wide in Mona Sans (it gets relatively wider at small sizes) and 18.4 em in the macOS fallback font. A size of 5.2cqi fits a 19.2 em title, about 4% headroom over the widest measurement.
Browsers without container units get min(4.6vw, 3rem) instead, which fits the column's content box at every viewport width.
Result: 48 px on desktop and large displays (was 72 px, wrapped); about 15 px on a 320 px phone.
Verification
Real Chromium against the live page with this CSS swapped in, at 12 widths from 280 to 3840 px, in Mona Sans and with the web font blocked: 24 of 24 cases on one line, inside the header, with no horizontal scroll.
The same run without container units (the vw fallback): 24 of 24.
A new unit test checks the sizing against the 19.2 em width at every viewport width from 280 to 4000 px. It caught all 6 mutations I tried:
The title was capped at 4.5rem in a 64rem column and wrapped. Size it
from the header's width with container units (5.2cqi, fitting a 19.2em
title: measured 18.3em in Mona Sans, 18.4em in the system fallback),
with a vw fallback, and stop it wrapping. Verified in Chromium from
280px to 3840px in both fonts and without container units.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The autofix added a calc((100vw - 32px) / 19.2) guard so the fallback
fits below ~274px, where main's padding stops shrinking. The test only
parsed a two-term min() and threw. Evaluate each vw, rem and calc term,
check every width from 200px to 4000px, and note the guard in the CSS.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Prevent fallback overflow when classic scrollbars reduce content width
leaderboard-service/public/board.css:54
In browsers that need this fallback, vw includes a classic vertical scrollbar, while main's auto width excludes it. The board is tall enough to scroll, so at a 280px viewport with a 15px scrollbar the header is about 233px wide, but this fallback sizes the measured Mona title to about 236px; nowrap can therefore reintroduce overflow/horizontal scrolling on Windows or Linux. Please make the fallback account for the scrollbar gutter (and cover that case in the test).
vw counts a classic vertical scrollbar but main's width does not, so
the no-container-units fallback could overflow on Windows/Linux. Size
it from main's content width less a 20px gutter (one term per padding
regime, plus the 3rem cap) and test gutters of 0, 17 and 20px. Checked
in Chromium with a real 20px scrollbar from 220px to 3840px.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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
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.
The public board's title, "GitHub Learn at Universe leaderboard", wrapped onto two lines. It could grow to 4.5rem (72 px), but the column it sits in is at most 64rem wide, and at that size the title is wider than the column.
Fix (
leaderboard-service/public/board.css)h1font size ismin(5.2cqi, 4.5rem)withwhite-space: nowrap.min(4.6vw, 3rem)instead, which fits the column's content box at every viewport width.Verification
npm test(311 tests) andnpm run checkpass.The live site changes only after a code deploy.