Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Modification Request] Add background image props to Hero component #793

Open
jjwinskill opened this issue Oct 17, 2024 · 1 comment
Open
Labels

Comments

@jjwinskill
Copy link

jjwinskill commented Oct 17, 2024

Many Primer Brand components, like Section and BreakoutBanner, follow a common pattern of accepting props that support a background image. We'd like to extend this pattern to the Hero component so we don't need a bespoke solution to using a background image with the Hero.

Specifically, would it be possible to add the following properties to the Hero component? (here I'm using packages/react/src/Section/Section.tsx for the sub types):

backgroundColor?: BackgroundColors | ResponsiveBackgroundColorMap
backgroundImageSrc?: string | string[] | ResponsiveBackgroundImageSrcMap
backgroundImagePosition?: string | string[] | ResponsiveBackgroundImagePositionMap
backgroundImageSize?: string | string[] | ResponsiveBackgroundImageSizeMap

This is similar to a separate request for the CTA banner #756

@rezrah rezrah added the brand label Oct 21, 2024
@rezrah
Copy link
Collaborator

rezrah commented Nov 4, 2024

Hi @jjwinskill 👋, thanks for putting in this request...

Do you have examples (either designs or production pages) where you are applying background images directly to Hero?

Asking because Hero is internally grid-constrained, and therefore not suitable for applying background images directly to. Instead, you'll want to apply background colors and images to a parent Section, and allow the Hero to align automatically inside of it.

Let us know if that approach works for you, or doesn't. I'd be curious to learn how you're planning to use those background options should we make them available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants