Skip to content

Commit 9b8ccce

Browse files
Fix Hero picture border radius (#1416)
1 parent 3c89bdc commit 9b8ccce

5 files changed

Lines changed: 45 additions & 0 deletions

File tree

.changeset/fuzzy-years-smile.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@primer/react-brand': patch
3+
---
4+
5+
Fixed the `Hero` image border radius when rendering a `picture` element.

packages/react/src/Hero/Hero.images-videos.stories.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,31 @@ export const WithImageBlockEndDefault: Story = {
4141
),
4242
}
4343

44+
export const WithPictureBlockEndDefault: Story = {
45+
name: 'Picture (left + bottom)',
46+
render: () => (
47+
<Grid>
48+
<Grid.Column>
49+
<Hero>
50+
<Hero.Label>Label</Hero.Label>
51+
<Hero.Heading>This is my super sweet hero heading</Hero.Heading>
52+
<Hero.Description>
53+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sapien sit ullamcorper id. Aliquam luctus sed
54+
turpis felis nam pulvinar risus elementum.
55+
</Hero.Description>
56+
<Hero.PrimaryAction href="#">Primary action</Hero.PrimaryAction>
57+
<Hero.Image
58+
as="picture"
59+
src={placeholderImage}
60+
sources={[{srcset: placeholderImage, media: '(min-width: 0)'}]}
61+
alt="placeholder image, blank with gray solid fill"
62+
/>
63+
</Hero>
64+
</Grid.Column>
65+
</Grid>
66+
),
67+
}
68+
4469
export const WithImageBlockEndCenter: Story = {
4570
name: 'Image (centered + bottom)',
4671
render: () => (

packages/react/src/Hero/Hero.module.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@
6767
width: 100%;
6868
}
6969

70+
.Hero-image > img {
71+
border-radius: inherit;
72+
}
73+
7074
.Hero-mediaContainer {
7175
width: 100%;
7276
height: 100%;

packages/react/src/Hero/Hero.visual.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,17 @@ test.describe('Visual Comparison: Hero', () => {
474474
await expect(page).toHaveScreenshot({fullPage: true})
475475
})
476476

477+
test('Hero / Picture (left + bottom)', async ({page}) => {
478+
await page.goto(
479+
'http://localhost:6006/iframe.html?args=&id=components-hero-features-images-and-videos--with-picture-block-end-default&viewMode=story',
480+
{waitUntil: 'networkidle'},
481+
)
482+
await page.locator('body.sb-show-main').waitFor({state: 'visible'})
483+
484+
await page.waitForTimeout(500)
485+
await expect(page).toHaveScreenshot({fullPage: true})
486+
})
487+
477488
test('Hero / Image (centered + bottom)', async ({page}) => {
478489
await page.goto(
479490
'http://localhost:6006/iframe.html?args=&id=components-hero-features-images-and-videos--with-image-block-end-center&viewMode=story',
39.3 KB
Loading

0 commit comments

Comments
 (0)