Use the figure component to show image, video (or other self-contained) content.
It has the following modifier:
--fixed-ratio for manual settable intrinsic ratios.Use the --fixed-ratio modifier to create an intrinsic ratio that scales on any device.
Rules are directly applied to <iframe>, <embed>, <video> and <object> elements*.
Optionally use an explicit descendant class .vi-figure__embed when you want to match the styling for other attributes.
When using the --fixed-ratio modifier, without any further modifiers, you have to manualy set the padding-top on the .vi-figure__content element.
To calculate the padding-top percentage use 100% * height / width.
* For images use Rectangular Image.
<figure class="vi-figure vi-figure--fixed-ratio">
<div class="vi-figure__content vi-figure__content--fixed-ratio" style="padding-top: 56.379821958%;">
<img alt="alt text" loading="lazy" src="/assets/images/static/test-674x380.jpg" srcset="/assets/images/static/test-674x380.jpg, /assets/images/static/test-1348x760.jpg 2x">
</div>
</figure>
Deprecated please use Rectangular Image with --hero-image modifier.
The following stylesheet is required to display this component.
The following stylesheet is required to display this component.
Usage documentation can be found here.
Changelog
Changed
- Deprecated
--ratio-hero-image preset. Use Rectangular Image with --hero-image modifier.
Added
- Initial draft