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
Next.js Image applies
max-width: 100%by default, which constrains the landscape image's width. Withobject-contain, that reduces the height to maintain aspect ratio, leaving whitespace.To make a fixed-height gallery:
h-[var(--slide-height)]tofigureelementsflex items-center justify-centerto center images within their containersmax-w-noneto allImagecomponents to override Next.js’s defaultmax-width: 100%