Skip to content

573 - storybook hero and DS fixes#574

Open
flacoman91 wants to merge 4 commits into
mainfrom
rad-hero-fix
Open

573 - storybook hero and DS fixes#574
flacoman91 wants to merge 4 commits into
mainfrom
rad-hero-fix

Conversation

@flacoman91
Copy link
Copy Markdown
Collaborator

Addresses #573

Hero and Storybook preview were drifting from what the DS actually does, so this tightens both up.
For the Hero, we were using an inside .m-hero__image while the DS pattern is an empty node with background-image and a fixed aspect ratio.

The img natural height drive the grid row, which is why the wrapper looked so tall compared to cfpb.gov.

We switched to the background-image (how DS does it) approach and use aspect-ratio: 940 / 390 to match the usual 940×390 art (same idea as the old padding-bottom: ~41.49% hack on live pages).

Overlay/photo heroes use a 16:9 slot on that node for mobile.

Tests now target role="img" instead of alt on an img.

On Storybook, we stopped applying the long-form layout tweaks (paragraph max-width, pre styling, etc.) to #storybook-root so the canvas is just DS + component CSS.

Those rules only apply under #storybook-docs now.

We also set layout: 'fullscreen' so we’re not losing width to the default padded body. Viewport defaults are a bit clearer (explicit desktop preset, desktop width aligned with how we test large layouts).

This should fix what you see on the Landing page in CE when it gets merged in.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 11, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cfpb.github.io/design-system-react/pr-previews/pr-574/

Built to branch gh-pages at 2026-05-12 00:24 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

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