<div class="banner banner--gradient">
<picture>
<source media="(max-width: 600px)" srcset="/assets/example-content/womens-hero-600.png">
<source media="(min-width: 600px)" srcset="/assets/example-content/womens-hero.png">
<img src="/assets/example-content/womens-hero.png" alt="">
</picture>
</div>
Both the hero image banner and the image on the hero video banner have the same logic:
{
"smallimage": "/assets/example-content/womens-hero-600.png",
"bigimage": "/assets/example-content/womens-hero.png",
"overlay": {
"xlstyle": true
},
"modifier": "gradient"
}
.banner {
position: relative;
img {
// used for smaller devices
height: 640px;
object-fit: cover;
object-position: center;
max-height: 700px;
width: 100%;
}
@media screen and (min-width: 1200px) {
img {
height: 100%;
}
}
&--gradient {
position: relative;
&::after {
background: linear-gradient(
180deg,
rgba(var(--brand-primary-rgb), 0) 0%,
rgba(var(--brand-primary-rgb), 0.14) 54.17%,
var(--brand-primary) 94.79%
);
bottom: 0;
content: '';
display: block;
height: 100%;
position: absolute;
top: 0;
width: 100%;
}
}
}
<div class="banner {{#if stylemodifier}}banner--{{stylemodifier}}{{/if}} {{#if modifier}}banner--{{modifier}}{{/if}}">
<picture>
<source media="(max-width: 600px)" srcset="{{smallimage}}">
<source media="(min-width: 600px)" srcset="{{bigimage}}">
<img src="{{bigimage}}" alt="">
</picture>
{{#if with-overlay}}
{{render '@hero-overlay' overlay merge="true"}}
{{/if}}
</div>