diff --git a/dotcom-rendering/src/components/Card/Card.tsx b/dotcom-rendering/src/components/Card/Card.tsx index dd0e2cdfcd1..6c37520f087 100644 --- a/dotcom-rendering/src/components/Card/Card.tsx +++ b/dotcom-rendering/src/components/Card/Card.tsx @@ -732,6 +732,7 @@ export const Card = ({ showTopBarMobile={showTopBarMobile} containerPalette={containerPalette} isOnwardContent={isOnwardContent} + cardBackgroundColour={backgroundColour} > {(isVideoMainMedia || - (isVideoArticle && !isBetaContainer)) && + (isVideoArticle && + containerType === 'fixed/video')) && mainMedia.duration > 0 && (
{ } }; +const isVerticalLayout = (imagePosition: ImagePositionType) => { + return imagePosition === 'top' || imagePosition === 'bottom'; +}; + export const CardLayout = ({ children, - cardBackgroundColour, imagePositionOnDesktop, imagePositionOnMobile, minWidthInPixels, @@ -180,9 +193,10 @@ export const CardLayout = ({ isBetaContainer, imageType === 'avatar', ), + isVerticalLayout(imagePositionOnMobile) && mobileFlexBasis, + isVerticalLayout(imagePositionOnDesktop) && desktopFlexBasis, ]} style={{ - backgroundColor: cardBackgroundColour, rowGap: decideGap(gapSizes.row), columnGap: decideGap(gapSizes.column), }} diff --git a/dotcom-rendering/src/components/Card/components/CardWrapper.tsx b/dotcom-rendering/src/components/Card/components/CardWrapper.tsx index be734680d30..0df5b3145ce 100644 --- a/dotcom-rendering/src/components/Card/components/CardWrapper.tsx +++ b/dotcom-rendering/src/components/Card/components/CardWrapper.tsx @@ -9,6 +9,7 @@ import { FormatBoundary } from '../../FormatBoundary'; type Props = { children: React.ReactNode; format: ArticleFormat; + cardBackgroundColour: string; containerPalette?: DCRContainerPalette; showTopBarDesktop?: boolean; showTopBarMobile?: boolean; @@ -98,6 +99,7 @@ export const CardWrapper = ({ showTopBarDesktop = true, showTopBarMobile = false, isOnwardContent = false, + cardBackgroundColour, }: Props) => { return ( @@ -111,6 +113,7 @@ export const CardWrapper = ({ showTopBarMobile && mobileTopBarStyles, isOnwardContent && onwardContentStyles, ]} + style={{ backgroundColor: cardBackgroundColour }} > {children}