Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update small card headline styles for mobile #12555

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 31 additions & 23 deletions dotcom-rendering/src/components/CardHeadline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
between,
from,
headlineMedium14,
headlineMedium15,
headlineMedium17,
headlineMedium20,
headlineMedium24,
Expand Down Expand Up @@ -166,6 +167,15 @@ const fontStylesOnMobile = ({
}
`;
case 'small':
return css`
${until.desktop} {
${headlineMedium15}
}
${between.tablet.and.desktop} {
${headlineMedium17}
}
`;
case 'tiny':
return css`
${until.mobileMedium} {
${headlineMedium14}
Expand All @@ -174,8 +184,6 @@ const fontStylesOnMobile = ({
${headlineMedium17}
}
`;
default:
return undefined;
}
};

Expand Down Expand Up @@ -293,27 +301,27 @@ export const CardHeadline = ({
className={`${
isSublink ? 'card-sublink-headline' : 'card-headline'
}`}
css={[
format.theme !== ArticleSpecial.Labs &&
fontStylesOnMobile({
size: sizeOnMobile ?? size,
boostedFontSizes,
}),

format.theme !== ArticleSpecial.Labs &&
fontStylesOnTablet({
size: sizeOnTablet,
boostedFontSizes,
}),
format.theme === ArticleSpecial.Labs
? labTextStyles(size)
: fontStyles({ size, boostedFontSizes }),
isSublink &&
size === 'tiny' &&
css`
${textSans14}
`,
]}
css={
isSublink && size === 'tiny'
? css`
${textSans14}
`
: [
format.theme !== ArticleSpecial.Labs &&
fontStylesOnMobile({
size: sizeOnMobile ?? size,
boostedFontSizes,
}),
format.theme !== ArticleSpecial.Labs &&
fontStylesOnTablet({
size: sizeOnTablet,
boostedFontSizes,
}),
format.theme === ArticleSpecial.Labs
? labTextStyles(size)
: fontStyles({ size, boostedFontSizes }),
]
}
>
{!!kickerText && (
<Kicker
Expand Down
6 changes: 6 additions & 0 deletions dotcom-rendering/src/components/DynamicPackage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,12 @@ const Card75_ColumnOfCards25 = ({
? 'medium'
: 'small'
}
headlineSizeOnMobile={
cardIndex === 0 ||
remaining.length === 2
? undefined
: 'tiny'
}
supportingContent={limitSupportingContent(
card,
)}
Expand Down
1 change: 1 addition & 0 deletions dotcom-rendering/src/components/FixedSmallSlowVThird.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export const FixedSmallSlowVThird = ({
showAge={showAge}
absoluteServerTimes={absoluteServerTimes}
headlineSize="small"
headlineSizeOnMobile="tiny"
imagePositionOnDesktop="left"
imagePositionOnMobile="none"
imageSize="small"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export const HighlightsCard = ({
headlineText={headlineText}
format={format}
size="medium"
sizeOnMobile="small"
sizeOnMobile="tiny"
showPulsingDot={
format.design === ArticleDesign.LiveBlog
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,6 @@ export const ScrollableSmall = ({
showAge={!!showAge}
headlineSize="small"
headlineSizeOnMobile="small"
headlineSizeOnTablet="small"
imagePositionOnDesktop="left"
imagePositionOnMobile="left"
imageSize="small" // TODO - needs fixed width images
Expand Down
1 change: 1 addition & 0 deletions dotcom-rendering/src/components/ShowMore.importable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ export const ShowMore = ({
containerPalette={containerPalette}
showAge={showAge}
headlineSize="small"
headlineSizeOnMobile="tiny"
imageLoading="eager"
absoluteServerTimes={false}
/>
Expand Down
3 changes: 3 additions & 0 deletions dotcom-rendering/src/lib/cardWrappers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,7 @@ export const CardDefault = ({
imageLoading={'lazy'}
avatarUrl={undefined}
headlineSize="small"
headlineSizeOnMobile="tiny"
isPlayableMediaCard={false}
isTagPage={isTagPage}
/>
Expand Down Expand Up @@ -842,6 +843,7 @@ export const CardDefaultMedia = ({
imageLoading={imageLoading}
isTagPage={isTagPage}
headlineSize="small"
headlineSizeOnMobile="tiny"
isPlayableMediaCard={false}
/>
);
Expand Down Expand Up @@ -879,6 +881,7 @@ export const CardDefaultMediaMobile = ({
imageLoading={imageLoading}
isTagPage={isTagPage}
headlineSize="small"
headlineSizeOnMobile="tiny"
isPlayableMediaCard={false}
/>
);
Expand Down
Loading