<figure class="full-width-image">
<div class="full-width-image__image">
<img src="../../img/Component-Centered-Image-Full-Width.jpg" alt="" loading="lazy" width="1470" height="549">
</div>
<figcaption class="full-width-image__caption text-content">Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim.</figcaption>
</figure>
<figure class="full-width-image">
<div class="full-width-image__image">
<img src="{{ image|path }}" alt="" loading="lazy" width="1470" height="549">
</div>
<figcaption class="full-width-image__caption text-content">{{ caption|raw }}</figcaption>
</figure>
{
"image": "../../img/Component-Centered-Image-Full-Width.jpg",
"caption": "Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim."
}
.paragraph-widget--full-width-image {
@extend %full-width-component;
}
.full-width-image {
margin: 0;
}
.full-width-image__image {
@extend %responsive-img;
&:before {
padding-top: 37.34%;
}
}
.full-width-image__caption {
@extend %caption;
@extend %outer-pad-x;
}
This is a custom component (no class prefix in place as it does not conflict with bootstrap)
full-width-image__image
element will be inline img
elements and are sized using the css object-fit
property (a polyfill is included for older browsers)index.scss
file as @import "../components/full-width-image/full-width-image";
<div class="paragraph-widget paragraph-widget--full-width-image">
.