Skip to content

fix(responsive): remove the 4k scale override - #10

Merged
devRMA merged 3 commits into
fix/tech-debt-and-bugsfrom
fix/4k-responsive
Aug 1, 2026
Merged

fix(responsive): remove the 4k scale override#10
devRMA merged 3 commits into
fix/tech-debt-and-bugsfrom
fix/4k-responsive

Conversation

@devRMA

@devRMAdevRMA commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Closes#7.

What was happening

app/globals.css declared a custom breakpoint and 170 hand-written 4k:* utilities across 17 files then multiplied every font size, padding, gap and icon dimension by two to four times — up to 4k:text-[14rem] for the headline number.

On a large display the site did not show more content, it showed the same content enormously magnified. That is the screenshot in the issue.

Two things worth knowing before reviewing

The breakpoint is misnamed. 2560px is QHD width, not 4K. Anyone on a 1440p monitor at 100% scaling was already getting the blow-up — which matches the report better than the issue title does.

Ten of the 170 utilities never worked at all.2560px is a px value while Tailwind's default breakpoints are rem, and mixing units breaks the variant sort order, so 4k: was emitted beforesm:2xl: and lost to any rem variant touching the same property. Measured at 3840×2160 before this change:

UtilityIntendedActually rendered
4k:max-w-[2400px]2400px1600px
4k:text-[14rem]224px96px
4k:text-5xl on the h148px24px

Why deleting is safe

4k: compiles to @media (width >= 2560px). None of the 170 utilities had any effect below 2560px, so removing them cannot change the layout at any width a normal viewport reports. There was no base class to restore anywhere — the properties were already unset under that threshold.

Large screens now get the normal type scale. Legibility on a high-DPI display is the browser's and the OS's job, and #9 restored the user's ability to do it by removing maximumScale: 1, which the 4k: overrides had been badly imitating.

Regression guard

Playwright ran Desktop Chrome at 1280 plus two phones, so nothing ever exercised the widths this issue is about. Added a QHD (2560×1440) and a 4K (3840×2160) project, plus tests/e2e/responsive.spec.ts:

  • the page never scrolls horizontally,
  • no control ends up outside the viewport,
  • headings stay under 40px — with the 4k: overrides in place the h2 measured 72px.

A test that had never run

Adding those two projects surfaced one. should show side ads on desktop after delay requires a viewport of at least 1536px and no project was ever that wide, so it had always taken its early-exit path. Running for the first time, it failed: the workflow sets NEXT_PUBLIC_ENABLE_ADS but never set NEXT_PUBLIC_ADSENSE_ID, and AdManager renders nothing without an ad client. Supplying a placeholder id makes the assertion real.

devRMAand others added 3 commits August 1, 2026 17:57
Closes#7.
`app/globals.css` declared a custom `--breakpoint-4k: 2560px`, and 170
hand-written `4k:*` utilities across 17 files then multiplied every font
size, padding, gap and icon dimension by two to four times — up to
`4k:text-[14rem]` for the headline number. On a large display the site did
not show more content, it showed the same content enormously magnified.
The breakpoint is also misnamed: 2560px is QHD width, not 4K. Anyone on a
1440p monitor at 100% scaling was already getting the blow-up, which
matches the report better than the issue title does.
Deleting the utilities cannot regress anything below 2560px, because
`4k:` compiles to `@media (width >= 2560px)` — none of the 170 had any
effect at normal widths. Large screens now get the normal type scale, and
legibility is left to browser and OS zoom, which is what the removal of
`maximumScale: 1` restored.
Ten of the utilities never worked at all. `2560px` is a px value while
Tailwind's default breakpoints are rem, and mixing units breaks the variant
sort order, so `4k:` was emitted before `sm:`…`2xl:` and lost to any rem
variant touching the same property. Measured at 3840x2160,
`4k:max-w-[2400px]` produced a 1600px container and `4k:text-[14rem]`
produced 96px.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Playwright ran Desktop Chrome at 1280 plus two phones, so nothing ever
exercised the widths the issue was about. Added a QHD (2560x1440) and a 4K
(3840x2160) project — QHD is where the removed breakpoint actually fired.
The new spec asserts the page never scrolls horizontally, that no control
ends up outside the viewport, and that headings stay under 40px. That last
one is the direct regression guard: with the `4k:` overrides in place the
`h2` measured 72px.
Adding the two projects surfaced a test that had never once executed.
`should show side ads on desktop after delay` requires a viewport of at
least 1536px, and no project was that wide — so it had always taken its
early-exit path. Running for the first time, it failed: the workflow sets
`NEXT_PUBLIC_ENABLE_ADS` but never set `NEXT_PUBLIC_ADSENSE_ID`, and
`AdManager` renders nothing without an ad client. Supplying a placeholder
id makes the assertion real.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Biome wants the destructured parameter broken across lines. Without it
`biome ci .` fails on this branch, which would have taken the whole checks
job down.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vercel

vercelBot commented Aug 1, 2026

Copy link
Copy Markdown

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

ProjectDeploymentActionsUpdated (UTC)
workloadReadyReadyPreviewAug 1, 2026 9:12pm

@devRMAdevRMA changed the title fix/4k responsivefix(responsive): remove the 4k scale overrideAug 1, 2026
@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!

@devRMAdevRMA self-assigned this Aug 1, 2026
@devRMA
devRMA marked this pull request as ready for review August 1, 2026 21:45
@devRMA
devRMA merged commit 9a0661f into mainAug 1, 2026
4 checks passed
@devRMA
devRMA deleted the fix/4k-responsive branch August 1, 2026 21:47
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.

Responsivo não está funcionando em telas 4k

2 participants

@devRMA@codecov-commenter