Skip to content

Commit eea5017

Browse files
committed
Move background colour to wrapper rather than only content
1 parent 3e97785 commit eea5017

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

dotcom-rendering/src/components/Card/Card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,7 @@ export const Card = ({
732732
showTopBarMobile={showTopBarMobile}
733733
containerPalette={containerPalette}
734734
isOnwardContent={isOnwardContent}
735+
cardBackgroundColour={backgroundColour}
735736
>
736737
<CardLink
737738
linkTo={linkTo}
@@ -782,7 +783,6 @@ export const Card = ({
782783
)}
783784

784785
<CardLayout
785-
cardBackgroundColour={backgroundColour}
786786
imagePositionOnDesktop={imagePositionOnDesktop}
787787
imagePositionOnMobile={imagePositionOnMobile}
788788
minWidthInPixels={minWidthInPixels}

dotcom-rendering/src/components/Card/components/CardLayout.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export type GapSizes = { row: GapSize; column: GapSize };
1313

1414
type Props = {
1515
children: React.ReactNode;
16-
cardBackgroundColour: string;
1716
imageType: CardImageType | undefined;
1817
imagePositionOnDesktop: ImagePositionType;
1918
imagePositionOnMobile: ImagePositionType;
@@ -173,7 +172,6 @@ const isVerticalLayout = (imagePosition: ImagePositionType) => {
173172

174173
export const CardLayout = ({
175174
children,
176-
cardBackgroundColour,
177175
imagePositionOnDesktop,
178176
imagePositionOnMobile,
179177
minWidthInPixels,
@@ -199,7 +197,6 @@ export const CardLayout = ({
199197
isVerticalLayout(imagePositionOnDesktop) && desktopFlexBasis,
200198
]}
201199
style={{
202-
backgroundColor: cardBackgroundColour,
203200
rowGap: decideGap(gapSizes.row),
204201
columnGap: decideGap(gapSizes.column),
205202
}}

dotcom-rendering/src/components/Card/components/CardWrapper.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { FormatBoundary } from '../../FormatBoundary';
99
type Props = {
1010
children: React.ReactNode;
1111
format: ArticleFormat;
12+
cardBackgroundColour: string;
1213
containerPalette?: DCRContainerPalette;
1314
showTopBarDesktop?: boolean;
1415
showTopBarMobile?: boolean;
@@ -98,6 +99,7 @@ export const CardWrapper = ({
9899
showTopBarDesktop = true,
99100
showTopBarMobile = false,
100101
isOnwardContent = false,
102+
cardBackgroundColour,
101103
}: Props) => {
102104
return (
103105
<FormatBoundary format={format}>
@@ -111,6 +113,7 @@ export const CardWrapper = ({
111113
showTopBarMobile && mobileTopBarStyles,
112114
isOnwardContent && onwardContentStyles,
113115
]}
116+
style={{ backgroundColor: cardBackgroundColour }}
114117
>
115118
{children}
116119
</div>

0 commit comments

Comments
 (0)