Skip to content

Fix Portfolio background image aspect-ratio warning - #92

Merged
Suede0619 merged 3 commits into
deployfrom
brand-steward/portfolio-image-fix
Jul 19, 2026
Merged

Fix Portfolio background image aspect-ratio warning#92
Suede0619 merged 3 commits into
deployfrom
brand-steward/portfolio-image-fix

Conversation

@Suede0619

Copy link
Copy Markdown
Member

Summary

  • Fixes the "either width or height modified, but not the other" console warning on the Portfolio (case studies) background image
  • Adds priority since Next.js flagged this image as the page's LCP candidate

Why

Tailwind's preflight forces height: auto on every <img> tag, which conflicted with the explicit height={843} prop. Fixed with an inline style matching both dimensions explicitly (inline styles win over the preflight rule via specificity).

Test plan

  • bun run build — clean
  • Verified via headless Chrome + CDP console capture: warning gone, no new warnings introduced
  • Verified rendered dimensions match original (632×843, 0.75 aspect ratio) via computed-style check — caught and fixed a regression from an earlier attempt before this one

Tailwind's preflight forces height:auto on every <img>, which
conflicted with the explicit height prop and triggered Next.js's
"either width or height modified" warning. Fixed with an explicit
inline style matching both dimensions (wins over preflight via
specificity). Also set priority since Next flagged this image as the
page's LCP candidate.

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

vercel Bot commented Jul 18, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

You don't have permission to create a Preview Deployment for this Vercel project: website.

View Documentation: https://vercel.com/docs/accounts/team-members-and-roles

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4cc0fb55-43e4-4e22-8838-dfaa02c53207

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch brand-steward/portfolio-image-fix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Suede0619 and others added 2 commits July 19, 2026 11:01
- ServicesSection/PortfolioSection: 40px top margin on the section
  eyebrow labels on mobile only (mt-10 md:mt-0), matching Tailwind's
  default spacing scale rather than an arbitrary value.
- PortfolioSection: flex-grow -> grow, flex-shrink-0 -> shrink-0
  (deprecated Tailwind names; confirmed identical compiled CSS).
- PortfolioSection: removed [&]:!hidden, [&]:lg:!block, [&]:!grid --
  redundant duplicates of hidden, lg:block, and grid respectively
  (confirmed via compiled CSS output, same computed values). Kept
  the one non-redundant class, converting [&]:lg:!hidden to its
  plain equivalent lg:hidden since nothing else needs the
  !important override. Verified the desktop-carousel/mobile-grid
  toggle still switches correctly at the lg breakpoint via computed
  style checks at 375px/800px/1400px.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The previous fix set style={{ width: "632px", height: "843px" }} to
resolve the aspect-ratio console warning. Tailwind's preflight
max-width:100% still correctly shrinks the width on narrow viewports,
but a hard-coded height has no equivalent responsive cap. On mobile
the image rendered 390px wide but stayed a fixed 843px tall instead
of scaling to ~520px, pushing the "Completed Quests" text below it
into an overlap.

Changed height back to "auto" so it scales proportionally with
whatever width actually renders, matching production's original
behavior. Width stays an explicit pixel value, satisfying Next's
"both width and height must be modified together" check.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Suede0619
Suede0619 merged commit 23f13f2 into deploy Jul 19, 2026
1 of 2 checks passed
@Suede0619
Suede0619 deleted the brand-steward/portfolio-image-fix branch July 19, 2026 17:18
skuhlmann added a commit that referenced this pull request Jul 20, 2026
* Fix Portfolio background image aspect-ratio warning (#92)

* Fix aspect-ratio warning and add priority to Portfolio background image

Tailwind's preflight forces height:auto on every <img>, which
conflicted with the explicit height prop and triggered Next.js's
"either width or height modified" warning. Fixed with an explicit
inline style matching both dimensions (wins over preflight via
specificity). Also set priority since Next flagged this image as the
page's LCP candidate.

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

* Add mobile label spacing, clean up deprecated/redundant Tailwind classes

- ServicesSection/PortfolioSection: 40px top margin on the section
  eyebrow labels on mobile only (mt-10 md:mt-0), matching Tailwind's
  default spacing scale rather than an arbitrary value.
- PortfolioSection: flex-grow -> grow, flex-shrink-0 -> shrink-0
  (deprecated Tailwind names; confirmed identical compiled CSS).
- PortfolioSection: removed [&]:!hidden, [&]:lg:!block, [&]:!grid --
  redundant duplicates of hidden, lg:block, and grid respectively
  (confirmed via compiled CSS output, same computed values). Kept
  the one non-redundant class, converting [&]:lg:!hidden to its
  plain equivalent lg:hidden since nothing else needs the
  !important override. Verified the desktop-carousel/mobile-grid
  toggle still switches correctly at the lg breakpoint via computed
  style checks at 375px/800px/1400px.

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

* Fix mobile regression: Portfolio background image height was hard-coded

The previous fix set style={{ width: "632px", height: "843px" }} to
resolve the aspect-ratio console warning. Tailwind's preflight
max-width:100% still correctly shrinks the width on narrow viewports,
but a hard-coded height has no equivalent responsive cap. On mobile
the image rendered 390px wide but stayed a fixed 843px tall instead
of scaling to ~520px, pushing the "Completed Quests" text below it
into an overlap.

Changed height back to "auto" so it scales proportionally with
whatever width actually renders, matching production's original
behavior. Width stays an explicit pixel value, satisfying Next's
"both width and height must be modified together" check.

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

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>

* Update hero copy: "is the OG decentralized collective" (#93)

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>

* Deploy (#87)

* bandaid on the client submission form

* feat: add Vercel Analytics integration (#76)

* feat: add Vercel Analytics integration

* fix: harden server analytics tracking

* fix: classify consultation submission errors

* feat: improve form error message handling (#77)

* feat: improve form error message handling

* fix: wire services field accessibility

* docs: add PR review workflow documentation

* removes fathom (#78)

* adds homepage content and contact form (#80)

* Update cohort join page to link to Portal join (#81)

* CR #131: Update cohort join page to link to Portal join

* CR #131: Update cohort join page to link to Portal join

* CR #131: Remove dependency lockfile churn

---------

Co-authored-by: Prism Codex <prism-codex@users.noreply.github.com>

* Add Join navigation link on website root page (#83)

* CR #133: Add Join navigation link on website root page

* CR #133: Add Join navigation link on website root page

* Revert "CR #133: Add Join navigation link on website root page"

This reverts commit 5bc6eb0.

---------

Co-authored-by: Prism Codex <prism-codex@users.noreply.github.com>

* Ai solutions (#84)

* adds ai solutions services

* removes contact page

* more add

* Install Plausible analytics script (#86)

Co-authored-by: Prism Codex <prism-codex@users.noreply.github.com>

* Add Plausible hire funnel events (#89)

Co-authored-by: Prism Codex <prism-codex@users.noreply.github.com>

---------

Co-authored-by: Sam Kuhlmann <samkuhlmann@gmail.com>
Co-authored-by: ECWireless <40322776+ECWireless@users.noreply.github.com>
Co-authored-by: Queen Raida <raidguildbot@gmail.com>
Co-authored-by: Prism Codex <prism-codex@users.noreply.github.com>

---------

Co-authored-by: Suede <101133311+Suede0619@users.noreply.github.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: Dekan <dekanbro@gmail.com>
Co-authored-by: ECWireless <40322776+ECWireless@users.noreply.github.com>
Co-authored-by: Queen Raida <raidguildbot@gmail.com>
Co-authored-by: Prism Codex <prism-codex@users.noreply.github.com>
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