Skip to content

Commit

Permalink
restoring dynamic height in HeroMedia (#715)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephiescastle authored Jan 28, 2025
1 parent bc7847d commit 1284445
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 36 deletions.
6 changes: 3 additions & 3 deletions packages/common/src/scss/components/_HeroMedia.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.HeroMedia {
> div > .vh-crop {
@screen sm {
max-height: 65vh;
max-height: 40vh;
min-height: 255px;
}

Expand All @@ -10,11 +10,11 @@
}

@screen lg {
min-height: 375px;
min-height: 345px;
}

@screen xl {
min-height: 430px;
min-height: 400px;
}

> .hero {
Expand Down
68 changes: 35 additions & 33 deletions packages/vue/src/components/HeroMedia/HeroMedia.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,42 @@
v-if="image || video"
class="HeroMedia"
>
<div class="vh-crop max-w-screen-3xl relative flex items-center mx-auto overflow-hidden">
<div class="hero w-full">
<template v-if="theImageData">
<img
v-if="theImageData.src"
class="object-cover object-center w-full h-full"
:srcset="theSrcSet"
:src="theImageData.src.url"
:width="theImageData.src.width"
:height="theImageData.src.height"
:alt="theImageData.alt"
itemprop="image"
data-chromatic="ignore"
/>
</template>
<template v-else-if="video">
<MixinVideoBg :video="video" />
</template>
</div>
<div
v-if="hasCaptionArea"
class="lg:hidden absolute bottom-0 left-0 w-full h-auto mx-auto print:hidden"
>
<button
class="bg-opacity-90 text-gray-dark flex items-center justify-center w-12 h-12 ml-auto bg-white cursor-pointer"
aria-label="Toggle caption"
@click="toggleCaption"
<div>
<div class="vh-crop max-w-screen-3xl relative flex items-center mx-auto overflow-hidden">
<div class="hero w-full">
<template v-if="theImageData">
<img
v-if="theImageData.src"
class="object-cover object-center w-full h-full"
:srcset="theSrcSet"
:src="theImageData.src.url"
:width="theImageData.src.width"
:height="theImageData.src.height"
:alt="theImageData.alt"
itemprop="image"
data-chromatic="ignore"
/>
</template>
<template v-else-if="video">
<MixinVideoBg :video="video" />
</template>
</div>
<div
v-if="hasCaptionArea"
class="lg:hidden absolute bottom-0 left-0 w-full h-auto mx-auto print:hidden"
>
<IconInfo
v-show="!captionVisible"
class="text-xl"
/>
<IconClose v-show="captionVisible" />
</button>
<button
class="bg-opacity-90 text-gray-dark flex items-center justify-center w-12 h-12 ml-auto bg-white cursor-pointer"
aria-label="Toggle caption"
@click="toggleCaption"
>
<IconInfo
v-show="!captionVisible"
class="text-xl"
/>
<IconClose v-show="captionVisible" />
</button>
</div>
</div>
</div>

Expand Down

0 comments on commit 1284445

Please sign in to comment.