Skip to content

Commit 16147bd

Browse files
authored
Merge pull request #14291 from guardian/doml/scrollable-highlights-stories
Update Scrollable Highlights divider and stories
2 parents fcd7e2d + bb1841f commit 16147bd

File tree

4 files changed

+115
-117
lines changed

4 files changed

+115
-117
lines changed

dotcom-rendering/fixtures/manual/highlights-trails.ts

Lines changed: 63 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -163,160 +163,123 @@ export const trails: Array<DCRFrontCard> = [
163163
isImmersive: false,
164164
},
165165
{
166-
format: {
167-
theme: Pillar.Sport,
168-
design: ArticleDesign.Feature,
169-
display: ArticleDisplay.NumberedList,
170-
},
166+
format: { design: 15, display: 0, theme: 3 },
171167
dataLinkName: 'feature | group-0 | card-@1',
172-
url: '/football/article/2024/may/13/premier-league-10-talking-points-from-the-weekends-action',
173-
headline: 'Conceição off the bench to score injury time winner',
168+
url: '/film/2025/jul/26/jamie-lee-curtis-interview-plastic-surgery-power-age-freakier-friday',
169+
headline: '‘Generations of women have been disfigured’',
174170
trailText:
175-
'Arsenal can still improve, Erling Haaland perplexes and Thomas Frank feels the love from his players',
176-
starRating: undefined,
177-
webPublicationDate: '2024-05-13T07:00:21.000Z',
178-
kickerText: 'Football',
171+
'The actor explains how she is fighting back against the ‘cosmeceutical industrial complex’ and why she has finally found freedom at 66 years old',
172+
webPublicationDate: '2025-07-26T05:00:46.000Z',
173+
kickerText: 'Jamie Lee Curtis',
179174
supportingContent: [],
180-
discussionApiUrl:
181-
'https://discussion.code.dev-theguardian.com/discussion-api',
182-
discussionId: '/p/qhy2h',
183-
byline: 'Guardian sport',
175+
discussionApiUrl: 'https://discussion.theguardian.com/discussion-api',
176+
byline: 'Emma Brockes',
184177
showByline: false,
185178
snapData: {},
186179
isBoosted: false,
180+
boostLevel: 'default',
181+
isImmersive: false,
187182
isCrossword: false,
183+
isNewsletter: false,
188184
showQuotedHeadline: false,
189185
showLivePlayable: false,
190-
avatarUrl: undefined,
191-
mainMedia: undefined,
192186
isExternalLink: false,
193-
embedUri: undefined,
194-
branding: undefined,
195-
slideshowImages: undefined,
196187
showVideo: false,
197188
image: {
198-
src: 'https://media.guim.co.uk/ae0cb00e76ef1aa0ec283cfcfb91ba7378f8b9ec/0_0_5000_3000/master/5000.jpg',
189+
src: 'https://media.guim.co.uk/124e05fe0a184da074cca3d7037f3771fb1f794d/0_393_5504_5504/master/5504.jpg',
199190
altText:
200-
'From left: Nottingham Forest’s Murillo, Tottenham’s Micky van de Ven and Manchester City’s Erling Haaland.',
191+
'Portrait of Jamie Lee Curtis in a tartan jacket with her hands on her hips and sporting a huge pair of plastic red lips',
201192
},
202-
isImmersive: false,
203193
},
204194
{
205-
format: {
206-
theme: Pillar.Culture,
207-
design: ArticleDesign.Feature,
208-
display: ArticleDisplay.Standard,
209-
},
210-
dataLinkName: 'feature | group-0 | card-@2',
211-
url: '/tv-and-radio/article/2024/may/12/eurovision-2024-everything-we-learned-from-to-the-uk-wild-unpopularity',
212-
headline: 'Eurovision 2024: everything we learned',
195+
format: { design: 10, display: 0, theme: 2 },
196+
dataLinkName: 'feature | group-0 | card-@4',
197+
url: '/football/2025/jul/26/rise-of-michelle-agyemang-lioness-euro-2025',
198+
headline: 'The rapid rise of Michelle Agyemang',
213199
trailText:
214-
'Why did Olly Alexander fall flat in the public vote? Why didn’t Abba show up? And how did the trophy get smashed?',
215-
starRating: undefined,
216-
webPublicationDate: '2024-05-12T12:18:13.000Z',
217-
kickerText: 'Television',
200+
'Lioness has gone from prospect to superstar at Euro 2025 – and she’s got more than just football in her locker',
201+
webPublicationDate: '2025-07-26T10:00:49.000Z',
202+
kickerText: '‘She’s an inspiration’',
218203
supportingContent: [],
219-
discussionApiUrl:
220-
'https://discussion.code.dev-theguardian.com/discussion-api',
221-
discussionId: undefined,
222-
byline: 'Michael Hogan',
204+
discussionApiUrl: 'https://discussion.theguardian.com/discussion-api',
205+
discussionId: '/p/x2zav2',
206+
byline: 'Sammy Gecsoyler',
223207
showByline: false,
224208
snapData: {},
225209
isBoosted: false,
210+
boostLevel: 'default',
211+
isImmersive: false,
226212
isCrossword: false,
213+
isNewsletter: false,
227214
showQuotedHeadline: false,
228215
showLivePlayable: false,
229-
avatarUrl: undefined,
230-
mainMedia: undefined,
231216
isExternalLink: false,
232-
embedUri: undefined,
233-
branding: undefined,
234-
slideshowImages: undefined,
235217
showVideo: false,
236218
image: {
237-
src: 'https://media.guim.co.uk/b403e3cfdc32f5b6ba5d3f38fa44ba2ebf388a1c/0_130_4178_2508/master/4178.jpg',
219+
src: 'https://media.guim.co.uk/66cbecaa6c7ee8533f9438d3ebe8d1ee0288b550/542_0_5417_4334/master/5417.jpg',
238220
altText:
239-
'Olly Alexander and four dancers on stage during his performace.',
221+
"England v Italy - UEFA Women's EURO 2025 Semi-Final, Geneva, Switzerland - 22 Jul 2025<br>RESTRICTED TO EDITORIAL USE Mandatory Credit: Photo by Jose Breton/NurPhoto/Shutterstock (15409762ay) Michelle Agyemang forward of England and Arsenal FC with her teammates celebrate victory after the UEFA Womens EURO 2025 Semi-Final match between England and Italy at Stade de Geneve on July 22, 2025 in Geneva, Switzerland. England v Italy - UEFA Women's EURO 2025 Semi-Final, Geneva, Switzerland - 22 Jul 2025",
240222
},
241-
isImmersive: false,
242223
},
243224
{
244-
format: {
245-
theme: Pillar.Lifestyle,
246-
design: ArticleDesign.Standard,
247-
display: ArticleDisplay.Standard,
248-
},
249-
dataLinkName: 'news | group-0 | card-@3',
250-
url: '/money/article/2024/jul/22/number-of-new-uk-buy-to-let-mortgages-halves-in-just-over-a-year',
251-
headline:
252-
'Number of new UK buy-to-let mortgages halves in just over a year',
225+
format: { design: 8, display: 0, theme: 1 },
226+
dataLinkName: 'comment | group-0 | card-@5',
227+
url: '/commentisfree/2025/jul/26/keir-starmer-donald-trump-britain-scotland',
228+
headline: 'Donald Trump could drag Britain down with him',
253229
trailText:
254-
'Sector shrinks in size for first time since launch of products in 1996 as higher costs drive out investors',
255-
starRating: undefined,
256-
webPublicationDate: '2024-07-22T16:19:52.000Z',
257-
kickerText: undefined,
230+
'Why is the prime minister chasing after Trump in Scotland? His time would be better spent planning for a world beyond the ‘special relationship’, says Guardian foreign affairs commentator Simon Tisdall',
231+
webPublicationDate: '2025-07-26T05:00:46.000Z',
232+
kickerText: 'Simon Tisdall',
258233
supportingContent: [],
259-
discussionApiUrl:
260-
'https://discussion.code.dev-theguardian.com/discussion-api',
261-
discussionId: undefined,
262-
byline: 'Rupert Jones',
263-
showByline: false,
234+
discussionApiUrl: 'https://discussion.theguardian.com/discussion-api',
235+
byline: 'Simon Tisdall',
236+
showByline: true,
264237
snapData: {},
265238
isBoosted: false,
239+
boostLevel: 'default',
240+
isImmersive: false,
266241
isCrossword: false,
267-
showQuotedHeadline: false,
242+
isNewsletter: false,
243+
showQuotedHeadline: true,
268244
showLivePlayable: false,
269-
avatarUrl: undefined,
270-
mainMedia: undefined,
245+
avatarUrl:
246+
'https://uploads.guim.co.uk/2024/11/08/Simon_Tisdall_2024.png',
271247
isExternalLink: false,
272-
embedUri: undefined,
273-
branding: undefined,
274-
slideshowImages: undefined,
275248
showVideo: false,
276249
image: {
277-
src: 'https://media.guim.co.uk/dc9dcb8a8d29815e132f798b1d3e7acd528a9df3/0_295_5256_3153/master/5256.jpg',
278-
altText: 'A row of terraced houses with many To Let signs',
250+
src: 'https://media.guim.co.uk/1333864eaf5b9f618b033107857a4635f86f292f/487_0_7200_5760/master/7200.jpg',
251+
altText:
252+
'Keir Starmer handing an invitation from King Charles for a second state visit to Donald Trump, the White House, Washington, 27 February 2025.',
279253
},
280-
isImmersive: false,
281254
},
282255
{
283-
format: {
284-
theme: Pillar.Opinion,
285-
design: ArticleDesign.Comment,
286-
display: ArticleDisplay.Standard,
287-
},
288-
dataLinkName: 'comment | group-0 | card-@4',
289-
url: '/commentisfree/article/2024/may/10/piers-morgan-baby-reindeer-netflix-interview',
290-
headline: 'Restaurants are disproportionately expensive',
256+
format: { design: 18, display: 0, theme: 1 },
257+
dataLinkName: 'news | group-0 | card-@6',
258+
url: '/commentisfree/ng-interactive/2025/jul/26/ukraine-war-drawing-ella-baron',
259+
headline: 'Battles of the mind: drawing this endless war',
291260
trailText:
292-
'An interview with the woman who allegedly inspired the stalker character has been the latest jaw-dropper in the hit show’s afterlife, says the Guardian columnist Marina Hyde',
293-
starRating: undefined,
294-
webPublicationDate: '2024-05-10T14:02:28.000Z',
295-
kickerText: 'Marina Hyde',
261+
'The Guardian Opinion cartoonist reports on lives for ever changed by conflict',
262+
webPublicationDate: '2025-07-26T05:59:39.000Z',
263+
kickerText: 'Ella Baron in Ukraine',
296264
supportingContent: [],
297-
discussionApiUrl:
298-
'https://discussion.code.dev-theguardian.com/discussion-api',
299-
discussionId: undefined,
300-
byline: 'Marina Hyde',
265+
discussionApiUrl: 'https://discussion.theguardian.com/discussion-api',
266+
discussionId: '/p/x2m8hn',
267+
byline: 'Ella Baron in Ukraine',
301268
showByline: true,
302269
snapData: {},
303270
isBoosted: false,
271+
boostLevel: 'default',
272+
isImmersive: false,
304273
isCrossword: false,
305-
showQuotedHeadline: true,
274+
isNewsletter: false,
275+
showQuotedHeadline: false,
306276
showLivePlayable: false,
307-
avatarUrl: 'https://uploads.guim.co.uk/2022/12/05/Marina_Hyde.png',
308-
mainMedia: undefined,
309277
isExternalLink: false,
310-
embedUri: undefined,
311-
branding: undefined,
312-
slideshowImages: undefined,
313278
showVideo: false,
314279
image: {
315-
src: 'https://media.guim.co.uk/3718341a0b0da9a1d13f640c097a1388177fee8b/0_22_6000_3600/master/6000.jpg',
316-
altText:
317-
'Baby Reindeer writer and actor Richard Gadd (Donny Dunn) and Jessica Gunning, who plays Martha, in a still from the series.',
280+
src: 'https://media.guim.co.uk/87bf9c036b7e17cb220f539fb30c599673ddf4bc/1256_1721_4258_3407/master/4258.jpg',
281+
altText: 'Illustration',
318282
},
319-
isImmersive: false,
320283
},
321284
];
322285

dotcom-rendering/src/components/ScrollableHighlights.importable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const verticalLineStyles = css`
9191
bottom: 0;
9292
right: -10px;
9393
width: 1px;
94-
background-color: ${palette('--card-border-top')};
94+
background-color: ${palette('--highlights-container-separator')};
9595
transform: translateX(-50%);
9696
}
9797
`;
Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,96 @@
11
import type { Meta, StoryObj } from '@storybook/react';
22
import { defaultCard, trails } from '../../fixtures/manual/highlights-trails';
33
import { ScrollableHighlights } from './ScrollableHighlights.importable';
4+
import { Section } from './Section';
45

5-
export default {
6+
const meta: Meta<typeof ScrollableHighlights> = {
67
title: 'Components/Masthead/ScrollableHighlights',
78
component: ScrollableHighlights,
8-
args: {
9-
trails,
10-
},
11-
} as Meta;
9+
render: ({ ...args }) => (
10+
<Section
11+
shouldCenter={true}
12+
showSideBorders={false}
13+
fullWidth={true}
14+
showTopBorder={false}
15+
padSides={false}
16+
element="section"
17+
>
18+
<ScrollableHighlights {...args} />
19+
</Section>
20+
),
21+
};
1222

23+
export default meta;
1324
type Story = StoryObj<typeof ScrollableHighlights>;
1425

15-
export const Default = {};
26+
export const Default = {
27+
args: {
28+
trails: trails.slice(0, 6),
29+
},
30+
};
31+
32+
export const withEightCards = {
33+
name: 'With Eight Cards',
34+
args: {
35+
trails: trails.slice(0, 8),
36+
},
37+
};
1638

1739
export const withTwoLineKicker: Story = {
40+
...Default,
41+
name: 'With Two Line Kicker',
1842
args: {
1943
trails: [
2044
{
2145
...defaultCard,
2246
kickerText: 'UK Housing and Mortgages',
2347
},
24-
...trails,
48+
...Default.args.trails,
2549
],
2650
},
27-
name: 'With Two Line Kicker',
2851
};
2952

3053
export const withLiveKicker: Story = {
54+
...Default,
55+
name: 'With Live Kicker',
3156
args: {
3257
trails: [
3358
{
3459
...defaultCard,
3560
kickerText: 'Live',
3661
format: { display: 0, theme: 3, design: 11 },
3762
},
38-
...trails,
63+
...Default.args.trails,
3964
],
4065
},
41-
name: 'With Live Kicker',
4266
};
4367

4468
export const withFourLineHeadline: Story = {
69+
...Default,
70+
name: 'With Four Line Headline',
4571
args: {
4672
trails: [
4773
{
4874
...defaultCard,
4975
headline:
5076
'Really long headline to show what happens when it is long',
5177
},
52-
...trails,
78+
...Default.args.trails,
5379
],
5480
},
55-
name: 'With Four Line Headline',
5681
};
5782

5883
export const withExcessivleyLongHeadline: Story = {
84+
...Default,
85+
name: 'With Excessively Long Headline',
5986
args: {
6087
trails: [
6188
{
6289
...defaultCard,
6390
headline:
6491
'Really long headline to show what happens when there is a really long headline that we will never ever have but we should check how it looks anyway',
6592
},
66-
...trails,
93+
...Default.args.trails,
6794
],
6895
},
69-
name: 'With Four Line Headline',
7096
};

dotcom-rendering/src/paletteDeclarations.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5771,7 +5771,12 @@ const highlightsContainerBackgroundLight: PaletteFunction = () =>
57715771
const highlightsContainerBackgroundDark: PaletteFunction = () =>
57725772
sourcePalette.neutral[10];
57735773

5774-
const hghlightsContainerBorderLight: PaletteFunction = () =>
5774+
const highlightsContainerSeparatorLight: PaletteFunction = () =>
5775+
sourcePalette.neutral[86];
5776+
const highlightsContainerSeparatorDark: PaletteFunction = () =>
5777+
sourcePalette.neutral[46];
5778+
5779+
const highlightsContainerBorderLight: PaletteFunction = () =>
57755780
sourcePalette.neutral[60];
57765781
const highlightsContainerBorderDark: PaletteFunction = () =>
57775782
sourcePalette.neutral[46];
@@ -7040,7 +7045,7 @@ const paletteColours = {
70407045
dark: highlightsContainerBackgroundDark,
70417046
},
70427047
'--highlights-container-border': {
7043-
light: hghlightsContainerBorderLight,
7048+
light: highlightsContainerBorderLight,
70447049
dark: highlightsContainerBorderDark,
70457050
},
70467051
'--highlights-container-end-fade': {
@@ -7051,6 +7056,10 @@ const paletteColours = {
70517056
light: highlightContainerMidFadeLight,
70527057
dark: highlightContainerMidFadeDark,
70537058
},
7059+
'--highlights-container-separator': {
7060+
light: highlightsContainerSeparatorLight,
7061+
dark: highlightsContainerSeparatorDark,
7062+
},
70547063
'--highlights-container-start-fade': {
70557064
light: highlightContainerStartLight,
70567065
dark: highlightContainerStartDark,

0 commit comments

Comments
 (0)