Skip to content

[Brand Refactor] Card fixes - #1428

Merged
danielguillan merged 8 commits into
mainfrom
danielguillan/brand-refactor-qa-card-updates
Aug 5, 2026
Merged

[Brand Refactor] Card fixes#1428
danielguillan merged 8 commits into
mainfrom
danielguillan/brand-refactor-qa-card-updates

Conversation

@danielguillan

@danielguillan danielguillan commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Resolves https://github.com/orgs/github/projects/23995/views/5?pane=issue&itemId=209292904
Resolves https://github.com/orgs/github/projects/23995/views/5?pane=issue&itemId=196242231

Addresses 2 items of Card QA feedback from the Brand Refactor board: responsive cards now match the intended compact layout and cards no longer scale on hover.

List of notable changes:

  • Exposes arrow CTA labels on devices without hover.
  • Restores Card recipe gridlines on mobile and removes duplicate wrapper padding.
  • Updates responsive Card padding
  • Removes the Card scale transform globally while preserving CTA arrow animations.

What should reviewers focus on?

  • Verify arrow CTA labels are visible on mobile and tablet devices without requiring hover.
  • Verify stacked Card recipes retain their gridlines and use the expected compact spacing at narrow viewports.
  • Verify Card icons render at the intended size and spacing on mobile.
  • Verify cards do not scale on hover at desktop widths while the arrow CTA interaction remains intact.
  • Check that desktop Card recipe spacing remains aligned after removing duplicate wrapper padding.

Steps to test:

Use the following Storybook links to verify the changes:

  1. Stacked cards — mobile: verify the gridlines, 32px block / 20px inline padding, 44px × 44px icons, 24px icon spacing, and visible CTA labels.
  2. Related content — mobile: verify the compact recipe layout without duplicate wrapper padding.
  3. Arrow CTA with a long label — mobile: verify the CTA label is exposed without hover and remains contained.
  4. Icon — desktop: hover the card and verify it does not scale.

Supporting resources (related issues, external links, etc):

Contributor checklist:

  • All new and existing CI checks pass
  • Tests prove that the feature works and covers both happy and unhappy paths
  • Any drop in coverage, breaking changes or regressions have been documented above
  • UI Changes contain new visual snapshots (generated by adding update snapshots label to the PR)
  • All developer debugging and non-functional logging has been removed
  • Related issues have been referenced in the PR description

Reviewer checklist:

  • Check that pull request and proposed changes adhere to our contribution guidelines and code of conduct
  • Check that tests prove the feature works and covers both happy and unhappy paths
  • Check that there aren't other open Pull Requests for the same update/change

@changeset-bot

changeset-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c1f60cd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@primer/react-brand Patch
@primer/brand-docs Patch
@primer/brand-css Patch
@primer/brand-primitives Patch
@primer/brand-e2e Patch
@primer/brand-fonts Patch
@primer/brand-mcp Patch
@primer/brand-config Patch
@primer/brand-storybook Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

🟢 No design token changes found

@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

🟢 No unit test coverage changes found

All components and hooks with tests maintain the same coverage as the main branch.

@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

🟢 Bundle size report

CheckMainBranchChange
UMD — full bundle (JS)101.76 kB101.76 kB🟢 No change
UMD — full bundle (CSS)67.61 kB67.57 kB✅ -39 B (-0.1%)
ESM — full bundle (JS + CSS)1.59 MB1.59 MB⬆️ +17 B (+0.0%)
ESM — tree-shaken simple (Button)70.85 kB70.86 kB⬆️ +15 B (+0.0%)
ESM — tree-shaken complex (ActionMenu)79.81 kB79.82 kB⬆️ +15 B (+0.0%)

@github-actions

Copy link
Copy Markdown
Contributor

🟢 No visual differences found

Our visual comparison tests did not find any differences in the UI.

@danielguillan
danielguillan marked this pull request as ready for review July 28, 2026 14:06
@danielguillan
danielguillan requested a review from a team as a code owner July 28, 2026 14:07
Copilot AI review requested due to automatic review settings July 28, 2026 14:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Card component’s responsive layout and interaction styling to address QA feedback: tighter spacing on narrow viewports, arrow CTA labels visible on non-hover devices, and removal of the hover scale effect while keeping arrow CTA motion.

Changes:

  • Adjust Card padding to be more compact on small screens, with desktop-specific inline padding.
  • Rework arrow CTA label/arrow-only styling to expose labels on non-hover devices while preserving hover/focus animations on hover-capable devices.
  • Update Card Storybook examples to remove wrapper padding now that spacing is handled by the component, and add a changeset entry.
Show a summary per file
File Description
packages/react/src/Card/Cards.example.stories.tsx Removes wrapper Box padding around Cards to avoid duplicate spacing in examples.
packages/react/src/Card/Card.module.css Updates Card padding and arrow CTA hover/non-hover behavior; removes global hover scale effect.
packages/react/src/Card/Card.features.stories.tsx Removes wrapper Box padding for stacked Cards in feature stories.
.changeset/tidy-cards-responsive.md Documents the patch-level changes for release notes.

Review details

  • Files reviewed: 4/8 changed files
  • Comments generated: 1
  • Review effort level: Low

Comment thread packages/react/src/Card/Card.module.css Outdated
@jesussandreas

Copy link
Copy Markdown
Collaborator

@danielguillan looks so much better.

one thing to note: do we want to expose the links when hover interactions are not available?

that's one of the recommendations i had, but how do you feel about that?

@danielguillan

Copy link
Copy Markdown
Collaborator Author

@jesussandreas Yes, that's already implemented. Check this example on a phone or tablet and you should see the label by default.

@danielguillan
danielguillan requested a review from rezrah July 30, 2026 18:03
justify-self: start;
}

@media (hover: hover) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice approach @danielguillan. Is there anything else worth/capable of hoisting into this progressive enhancement query? Maybe you've already done that. Just a nice opportunity to clean this up more.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! There was more we could hoist. Updated.

Comment thread packages/react/src/Card/Card.interaction.visual.spec.ts Outdated

@rezrah rezrah left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected. Love the opt-in for animation.

@danielguillan left some feedback around the interaction test.

@danielguillan
danielguillan merged commit 8ac13c8 into main Aug 5, 2026
17 checks passed
@danielguillan
danielguillan deleted the danielguillan/brand-refactor-qa-card-updates branch August 5, 2026 14:16
@primer primer Bot mentioned this pull request Aug 5, 2026
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.

4 participants