Skip to content

fix(ui): stop the hero value from wrapping mid-number - #16

Merged
devRMA merged 2 commits into
style/formatting-codefrom
fix/hero-panel-value-overflow
Aug 2, 2026
Merged

fix(ui): stop the hero value from wrapping mid-number#16
devRMA merged 2 commits into
style/formatting-codefrom
fix/hero-panel-value-overflow

Conversation

@devRMA

Copy link
Copy Markdown
Owner

The value used a fixed text-8xl with break-words, so anything longer
than about nine characters broke inside the number itself: "R$ 58.480,37"
rendered with the trailing "7" alone on a second line.

Size it against the panel instead of the viewport: the wrapper becomes a
container and the font scales with the character count, clamped between
1.5rem and the previous 6rem. Measured in Chromium at 375, 768, 1280,
1536 and 2560 px with values up to "R$ 926.150,68" - one line, no
overflow, at every size.

The size travels as a custom property because jsdom drops a fontSize
holding clamp() with cqi, which would leave the behaviour untestable.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com


Stack created with GitHub Stacks CLIGive Feedback 💬

@vercel

vercelBot commented Aug 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
workloadReadyReadyPreviewAug 2, 2026 6:47pm

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

This comment was marked as resolved.

devRMAand others added 2 commits August 2, 2026 15:41
The value used a fixed text-8xl with break-words, so anything longer
than about nine characters broke inside the number itself: "R$ 58.480,37"
rendered with the trailing "7" alone on a second line.
Size it against the panel instead of the viewport: the wrapper becomes a
container and the font scales with the character count, clamped between
1.5rem and the previous 6rem. Measured in Chromium at 375, 768, 1280,
1536 and 2560 px with values up to "R$ 926.150,68" - one line, no
overflow, at every size.
The size travels as a custom property because jsdom drops a fontSize
holding clamp() with cqi, which would leave the behaviour untestable.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Dividing by value.length gave Infinity for an empty string, so the
custom property became clamp(1.5rem, Infinitycqi, 6rem) - invalid CSS
that the browser drops entirely, falling back to the inherited size.
The test now reads the custom property off element.style rather than
regexing outerHTML, which would have matched any cqi in the subtree.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@devRMA
devRMAforce-pushed the fix/hero-panel-value-overflow branch from 8427171 to 4c772f7CompareAugust 2, 2026 18:46
@devRMA
devRMA merged commit c78ccfa into mainAug 2, 2026
4 checks passed
@devRMA
devRMA deleted the fix/hero-panel-value-overflow branch August 2, 2026 19:00
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@devRMA@codecov-commenter