Skip to content

Commit

Permalink
conditionally pad trailtext (#12575)
Browse files Browse the repository at this point in the history
  • Loading branch information
abeddow91 authored Oct 21, 2024
1 parent 7319722 commit f929e73
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions dotcom-rendering/src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,7 @@ export const Card = ({
shouldHide={isFlexSplash ? false : true}
trailTextColour={trailTextColour}
trailTextSize={trailTextSize}
padTop={headlinePosition === 'inner'}
>
<div
dangerouslySetInnerHTML={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type Props = {
trailTextSize?: TrailTextSize;
/** Optionally overrides the trail text colour */
trailTextColour?: string;
padTop: boolean;
};

/**
Expand Down Expand Up @@ -55,7 +56,11 @@ const decideVisibilityStyles = (
const trailTextStyles = css`
display: flex;
flex-direction: column;
padding: ${space[2]}px 0;
padding-bottom: ${space[2]}px;
`;

const topPadding = css`
padding-top: ${space[2]}px;
`;

const fontStyles = (trailTextSize: TrailTextSize) => css`
Expand All @@ -76,6 +81,7 @@ export const TrailTextWrapper = ({
shouldHide = true,
trailTextSize = 'regular',
trailTextColour = palette('--card-trail-text'),
padTop,
}: Props) => {
return (
<div
Expand All @@ -91,6 +97,7 @@ export const TrailTextWrapper = ({
imageSize,
imageType,
),
padTop && topPadding,
]}
>
{children}
Expand Down

0 comments on commit f929e73

Please sign in to comment.