Skip to content

fix(swap): sell amount renders at full size, not 14px - #286

Merged
sktbrd merged 1 commit into
mainfrom
fix/swap-input-size
Aug 23, 2026
Merged

fix(swap): sell amount renders at full size, not 14px#286
sktbrd merged 1 commit into
mainfrom
fix/swap-input-size

Conversation

@sktbrd

@sktbrd sktbrd commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

In the homepage swap section, the amount you type rendered at 14px while the amount you receive rendered at 44px — same widget, a few pixels apart.

Root cause

The shadcn Input ships md:text-sm in its base classes. tailwind-merge only evicts a conflicting class within the same modifier, so the widget's bare text-[44px] replaced text-base and left md:text-sm untouched. Above 768px md:text-sm then won wherever nothing else outbid it.

That is why it looked fine everywhere I first checked:

context container result
/swap full width @2xl @2xl:text-[56px] outbids → 56px, correct
homepage section < @2xl nothing outbids → 14px, wrong
phone (<768px) any md: inactive → 44px, correct

Restating the size under md: is what actually evicts it.

Changes

  • src/app/[locale]/swap/SwapWidget.tsx — add md:text-[44px] to the sell input, with a comment explaining why it is not redundant with the base size.

Test plan

  • Measured getComputedStyle().fontSize on the sell input vs the buy display in the homepage swap section, before and after, in a real browser:
    • before: SELL=14px BUY=44px (md:text-sm present on the element)
    • after: SELL=44px BUY=44px (md:text-sm evicted)
  • Re-checked the /swap page at 1500 / 1000 / 700px — 56/56, 56/56, 44/44, unchanged by this fix.
  • Screenshotted the homepage section with a value typed: the sell amount now matches the buy amount's scale.
  • Grepped for other Inputs given an oversized text class — this was the only one.
  • pnpm lint clean apart from one pre-existing warning in BountiesView.tsx; prettier --check passes.

Generated with Claude Code

On the homepage swap section the amount you type rendered at 14px while the
amount you receive rendered at 44px, in the same widget, a few pixels apart.

The shadcn Input ships `md:text-sm`. tailwind-merge only evicts a conflicting
class within the SAME modifier, so the widget's bare `text-[44px]` replaced
`text-base` and left `md:text-sm` standing. Wherever the widget's container
was under `@2xl` — the homepage column — nothing outbid it above 768px, and
the sell field dropped to 14px. The full-width /swap page hid the bug because
`@2xl:text-[56px]` applied there, and phones hid it because `md:` did not.

Restating the size under `md:` is what actually evicts it.

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

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

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

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
gnars-shadcn Ignored Ignored Aug 21, 2026 2:16pm
hackertestdao Ignored Ignored Aug 21, 2026 2:16pm

@sktbrd
sktbrd merged commit ce940d5 into main Aug 23, 2026
4 checks passed
Sign up for free to 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.

1 participant