Implement a Blossom Carousel containing a row of slides arranged using CSS Grid. The gallery contains 3 images and each has different dimensions. However, they must all have the same height and each should have their width be resulting from height and intrinsic aspect ratio.
Carousel height is pre-given (477px) and should be defined using a CSS Custom Property called --carousel-height
All images render using their intrinsic aspect ratio, there is no clipping, no cropping
Height is defined by the CSS Custom property therefore image width is automatic
All images are rendered using the same height (--carousel height)
Figure caption element’ width is equal to the width of the image it’s describing
Image gallery lives inside a Blossom Carousel and is always exactly one row; items never wrap
On smaller screens, images don’t get compressed horizontally but maintain their width as dictated by --carousel height and image’s intrinsic aspect ratio.
Use CSS Grid
Using CSS Subgrid is allowed
Consult Blossom Carousel documentation page https://blossom-carousel.com/docs/examples#css-grid
Implement images using placeholders, e.g.
Ignore older carousel implementations found elsewhere in the codebase
Import carousel from “src/components/carousel.tsx”
Prefer using Tailwind CSS over creating separate CSS files
This works. Note: without using relative/absolute, the
<figcaption>allocates more width than it should on Safari (macOS, iOS). Giving<figcaption>position: absolutemakes the image dictate the item width.