store: cart summary total overflows the viewport at a 24px root font (WCAG 1.4.10) #93
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found while verifying #91 across root font sizes. Pre-existing on
main, and confirmed not caused by that PR: neutralising its cart-line rules leaves the overflow in place, and no element inside.co-lineoverflows at all.Symptom
At a 24px root font (Chrome's largest built-in setting, roughly 400% zoom territory) on a 320px viewport,
/cartscrolls horizontally.The single offender
Exactly one element overflows the document:
span.pricein the summary panelRp 13.070.000clientWidthof 320pxdocumentElement.scrollWidthIt is the order total, not a cart line.
.summary .pricerenders large and bold, and at a 24px root a 13-million total simply exceeds the panel's content box.Why it matters
WCAG 1.4.10 Reflow asks for no two-dimensional scrolling at a 320px-equivalent width. A user at 400% zoom on a narrow phone gets exactly that, on the screen where they confirm what they are about to pay.
Scope note
This is the summary panel, so it is independent of the cart-line work in #91 and of the sticky-bar occlusion in #89. It reproduces on
main.Suggested direction
The total is the one string on the page guaranteed to be both large and long. Options, cheapest first:
Rp, sooverflow-wrapor simply allowing two lines in the total row would resolve it without changing type size.min()or a small@media (max-width: 390px)step, the way.sticky-buy .sb-price .pricealready steps down.Deriving the behaviour from the string's own length is better than a fixed breakpoint, since the digit count is what varies.
Verification for whoever takes it
Set the root font to 24px at a 320px viewport on
/cartwith a total in the tens of millions, then assertdocument.documentElement.scrollWidth === document.documentElement.clientWidth. It fails today at 353 vs 320.Sharpened after a 1px sweep by a second reviewer. The extent is two bands of different character, not two points, and the onset depends on the cart total — so a reproduction needs the total stated.
Two bands, only one of which fails the criterion
Clean from 353–900, because the stacked summary has the full width.
Only the first band matters for WCAG 1.4.10, which tests at 320 CSS px. The second is the same element with a 1px symptom — naming it separately so nobody spends a day on it thinking it is the 33px one.
It needs both a large total and a large root
Rp 13.070.000measures 174.09px at a 16px root and 217.67px at 20px — neither overflows. It takes roughly a 24px root to reach 261.14px.And the onset width scales with the total: with a four-item seed totalling
Rp 2.630.000(238.56px) the band shrinks to 320–329. So this should not be filed as a fixed-320px bug.Reproduction
Seed a cart whose total is in the tens of millions, set the root font to 24px, and set the viewport to 320px. Then:
fails at 353 vs 320, with
span.pricein.summaryas the single overflowing element.