Skip to content

Commit 2db7498

Browse files
Only apply bg color to object-contain images
1 parent b446473 commit 2db7498

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/react/src/carousel/carousel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ const CarouselItem = ({ className, children }: CarouselItemProps) => {
240240
{
241241
fit: 'cover',
242242
className: cx(
243-
'bg-blue-dark',
243+
'data-[fit="contain"]:bg-blue-dark',
244244
'*:w-full',
245245
// biome-ignore lint/nursery/useSortedClasses: biome is unable to sort the custom classes for 3xl and 4xl breakpoints
246246
'*:h-70 sm:*:h-[25rem] lg:*:h-[35rem] xl:*:h-[40rem] 2xl:*:h-[42rem] 3xl:*:h-[48rem] 4xl:*:h-[53rem]',

packages/react/src/content/content.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ const Media = ({ ref = null, ...props }: MediaProps) => {
123123
<div
124124
ref={ref}
125125
className={cx(className, _className)}
126+
// This can be used (internally) in other components
127+
// to apply custom styles to the media element depending on the fit
128+
data-fit={fit}
126129
{...restProps}
127130
data-slot="media"
128131
/>

0 commit comments

Comments
 (0)