Skip to content

fix(webkit): tighten the card-box header padding to spacing-sm - #842

Open
gabriel-lisboa-azion wants to merge 2 commits into
mainfrom
fix/card-box-header-padding
Open

fix(webkit): tighten the card-box header padding to spacing-sm#842
gabriel-lisboa-azion wants to merge 2 commits into
mainfrom
fix/card-box-header-padding

Conversation

@gabriel-lisboa-azion

@gabriel-lisboa-azion gabriel-lisboa-azion commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

What

One class on the CardBox header band: horizontal padding --spacing-md--spacing-sm.

-group flex min-h-14 … border-b border-[var(--border-default)] px-[var(--spacing-md)] py-[var(--spacing-sm)]
+group flex min-h-14 … border-b border-[var(--border-default)] px-[var(--spacing-sm)] py-[var(--spacing-sm)]

The header becomes square in its own padding (px = py = sm) and tighter than before.

⚠️ This needs a design call, not just a review

The change came out of console screens that wanted a tighter header inset, but it makes the card's three bands disagree on horizontal inset:

Band Inset after this PR
header --spacing-sm
content (padded) --spacing-md
footer --spacing-md

It also no longer lines up with the rows a card usually contains: an Item row is p-[var(--spacing-md)] at medium and px-[var(--spacing-md)] at small.

So the honest options are:

  1. Merge as-is — accept a header that is inset less than the body it labels.
  2. Extend to the whole card — move content and footer to sm too, so the card is internally consistent at the tighter density (bigger visual diff, more baselines).
  3. Close it — keep md in the design system and carry the tighter header in the consuming app.

I have no evidence for (1) beyond "it looked better in the screens it was built for", which is why it is spelled out rather than argued.

Note

Visible, so the linux/ baselines are regenerated on this branch. Expected diff scope: card-box stories plus components composing a card header.

Baseline scope (why only 4 files)

The regenerated linux/ baselines touch only the mobile card-box snapshots. That is the 1% pixel threshold the gate uses (toMatchImageSnapshot({ failureThreshold: 0.01, failureThresholdType: 'percent' })): the 4px title shift is ~1.3% of a 343×132 mobile canvas (over threshold → rewritten) and ~0.36% of a 1248×132 desktop one (under threshold → neither fails nor rewrites). Measured with pngjs: header title ink starts at x=14 on mobile vs x=18 on desktop, while the card body row sits at x=18 in both, so the crops share an origin.

Taken from console screens that wanted a tighter header inset; it also makes the
header square in its own padding (px = py = sm).

It leaves the card's bands disagreeing on horizontal inset — header sm, padded
content md, footer md — and no longer matching an Item row (md). That tradeoff is
spelled out in the PR for a design call rather than settled here.
…nset

Only the four mobile card-box snapshots move. The runner compares with
jest-image-snapshot at failureThreshold 0.01 (1% of pixels), so the 4px title
shift is 1.3% of a 343x132 mobile canvas (rewritten) and 0.36% of a 1248x132
desktop one (under threshold, so it neither fails nor rewrites).
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants