diff --git a/stories/Components/UIcomponents/Hero/PageHero/PageHero.jsx b/stories/Components/UIcomponents/Hero/PageHero/PageHero.jsx index ec5d3b1a3..2ca91330d 100644 --- a/stories/Components/UIcomponents/Hero/PageHero/PageHero.jsx +++ b/stories/Components/UIcomponents/Hero/PageHero/PageHero.jsx @@ -18,6 +18,7 @@ export function PageHero({ imgsrc, imgalt, cta, + mobileImagePosition = 'center', ...args }) { useEffect(() => { @@ -26,7 +27,7 @@ export function PageHero({ const textColor = variant === 'No background' ? 'Black' : 'White'; const textColorClass = variant === 'No background' ? 'color-black' : 'color-white'; - + const mobilePositionClass = `mobile-position-${mobileImagePosition}`; return (
{variant === 'Video' ? ( @@ -35,7 +36,7 @@ export function PageHero({ <> {variant !== 'No background' && imgsrc && (
- {imgalt} + {imgalt}
)} diff --git a/stories/Components/UIcomponents/Hero/PageHero/PageHero.stories.mdx b/stories/Components/UIcomponents/Hero/PageHero/PageHero.stories.mdx index 4bd20ad58..bbba2cfd0 100644 --- a/stories/Components/UIcomponents/Hero/PageHero/PageHero.stories.mdx +++ b/stories/Components/UIcomponents/Hero/PageHero/PageHero.stories.mdx @@ -141,12 +141,18 @@ export const getCaptionForLocale = (locale) => { options: ["On", "Off"], control: { type: "inline-radio" }, }, + MobileImagePosition: { + name: "Mobile Image Position", + options: ["left", "center", "right"], + control: { type: "inline-radio" }, + }, }} args={{ Variant: "Image", CTA: "Off", Overline: "Off", Subtitle: "Off", + MobileImagePosition: "center", }} /> @@ -203,6 +209,7 @@ There are two states in the Full-width Page- Default and Mobile. imgsrc={caption.imgsrc} imgalt={caption.imgalt} cta={cta} + mobileImagePosition={args.MobileImagePosition} {...args} > ); diff --git a/stories/Components/UIcomponents/Hero/PageHero/PageHeroOption.jsx b/stories/Components/UIcomponents/Hero/PageHero/PageHeroOption.jsx index 0debeac74..c25a02925 100644 --- a/stories/Components/UIcomponents/Hero/PageHero/PageHeroOption.jsx +++ b/stories/Components/UIcomponents/Hero/PageHero/PageHeroOption.jsx @@ -39,7 +39,8 @@ export function PageHeroOption({ ) : ( - {imgalt} + {imgalt} )}
diff --git a/stories/Components/UIcomponents/Hero/PageHero/page-hero.scss b/stories/Components/UIcomponents/Hero/PageHero/page-hero.scss index 0fa79d7c0..01e96f84c 100644 --- a/stories/Components/UIcomponents/Hero/PageHero/page-hero.scss +++ b/stories/Components/UIcomponents/Hero/PageHero/page-hero.scss @@ -74,6 +74,24 @@ margin-bottom: 0; } } + + img { + @include devicebreak(small) { + @extend %img-cover; + + &.mobile-position-left { + object-position: left; + } + + &.mobile-position-center { + object-position: center; + } + + &.mobile-position-right { + object-position: right; + } + } + } } &-content { @@ -143,15 +161,6 @@ @include devicebreak(medium) { height: 100%; } - - img, - video { - @extend %img-cover; - - @include devicebreak(small) { - position: absolute; - } - } } &-tall {