Skip to content

Improve scrollable carousel and onwards content carousel accessibility - #15390

Merged
domlander merged 5 commits into
mainfrom
doml/carousel-accessiblity
Feb 19, 2026
Merged

domlander merged 5 commits into
mainfrom
doml/carousel-accessiblity

Conversation

@domlander

@domlander domlander commented Feb 19, 2026

Copy link
Copy Markdown
Contributor

What does this change?

Adds aria attributes to the following front collections that use carousels:

  • scrollable/feature
  • scrollable/medium
  • scrollable/small

Adds aria attributes to the onwards content front.

Why?

Better accessibility when using a screen reader.

Extends #15365

Screenshares

Front carousel

Before

Screen.Recording.2026-02-19.at.11.31.05.mov

After

Screen.Recording.2026-02-19.at.11.35.53.mov

Onwards content carousel

Before

Screen.Recording.2026-02-19.at.11.40.30.mov

After

Screen.Recording.2026-02-19.at.11.38.55.mov

@domlander domlander self-assigned this Feb 19, 2026
@domlander domlander added run_chromatic Runs chromatic when label is applied fronts + curation maintenance Departmental tracking: maintenance work, not a fix or a feature labels Feb 19, 2026
@github-actions

github-actions Bot commented Feb 19, 2026

Copy link
Copy Markdown

@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Feb 19, 2026
@domlander
domlander marked this pull request as ready for review February 19, 2026 11:44
@github-actions

Copy link
Copy Markdown

Hello 👋! When you're ready to run Chromatic, please apply the run_chromatic label to this PR.

You will need to reapply the label each time you want to run Chromatic.

Click here to see the Chromatic project.

@domlander
domlander marked this pull request as draft February 19, 2026 11:44
@domlander
domlander force-pushed the doml/carousel-accessiblity branch from ffe0963 to 0e5badb Compare February 19, 2026 11:52
@domlander
domlander marked this pull request as ready for review February 19, 2026 12:13
@domlander domlander added the run_chromatic Runs chromatic when label is applied label Feb 19, 2026
width: 1px;
background-color: ${palette('--onward-content-border')};
}
ul {

@domlander domlander Feb 19, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has changed from ol to ul. Ideally we could refactor to not target elements in this way as it is a little brittle, but will leave for now as this PR is fairly big.

@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Feb 19, 2026
if (isFrontBranding || isContainerBranding) {
return (
<div css={titleStyle}>
<div id={`${sectionId}-title`} css={titleStyle}>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So that aria-labelledby can target the appropriate element. This is better than prop drilling the title name down to the components that refer to it.

aspectRatio,
collectionId,
}: Props) => {
const isBelowTabletBreakpoint = useMatchMedia(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did consider whether the added accessibility was worth the extra javascript. I've come to the conclusion that if we are going to use carousels in this way then the extra javascript needed to make them more accessible should be built in to that decision.

return (
<div css={containerStyles}>
<ol
<ul

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

preferred to ol

#15389 (comment)

@abeddow91 abeddow91 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A massive improvement. Thanks for putting this together 👏

@domlander
domlander merged commit 7916f9a into main Feb 19, 2026
27 checks passed
@domlander
domlander deleted the doml/carousel-accessiblity branch February 19, 2026 15:18
@gu-prout

gu-prout Bot commented Feb 19, 2026

Copy link
Copy Markdown

Overdue on PROD (merged by @domlander 30 minutes and 7 seconds ago) What's gone wrong?

@gu-prout

gu-prout Bot commented Feb 19, 2026

Copy link
Copy Markdown

Seen on PROD (merged by @domlander 50 minutes and 4 seconds ago) Please check your changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fronts + curation maintenance Departmental tracking: maintenance work, not a fix or a feature Seen-on-PROD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants