Skip to content

Commit

Permalink
Fix hero asset styles
Browse files Browse the repository at this point in the history
  • Loading branch information
siffogh committed Oct 16, 2024
1 parent aa7d549 commit 7d761ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions storefront/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
--base-font-size: 16px;
}

.hero-asset {
min-height: min(590px, calc(100vh - var(--header-height) - 1rem));
}

.newletter-text:-webkit-autofill {
-webkit-box-shadow: 0 0 0px 1000px transparent inset !important;
box-shadow: 0 0 0px 1000px transparent inset !important;
Expand Down
6 changes: 3 additions & 3 deletions storefront/components/sections/hero/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ export default function Hero(props: ModularPageSection<"section.hero">) {
{mediaType === "image" && <SimpleHero {...props} />}
{mediaType === "video" && video && (
<LargeHero props={props}>
<div className="aspect-[16/9] min-h-[590px] w-full overflow-hidden rounded-lg object-cover object-center">
<div className="hero-asset grid w-full overflow-hidden rounded-lg object-cover object-center">
<Video
aspectRatio="16/9"
className="h-full w-full object-cover"
fetchPriority="high"
poster={video.poster}
videoUrl={video.url}
Expand All @@ -32,7 +32,7 @@ export default function Hero(props: ModularPageSection<"section.hero">) {
{mediaType === "largeImage" && largeImage && (
<LargeHero props={props}>
<SanityImage
className="aspect-[16/9] min-h-[590px] w-full rounded-lg object-cover object-center"
className="hero-asset w-full rounded-lg object-cover object-center"
data={largeImage}
fetchPriority="high"
/>
Expand Down

0 comments on commit 7d761ed

Please sign in to comment.