close
Skip to content

add accessibility section for CSS Custom Highlight API - #43469

Merged
Josh-Cena merged 4 commits into
mdn:mainfrom
mohammed-ali-osman:add-css-api-accessibility
Aug 12, 2026
Merged

add accessibility section for CSS Custom Highlight API#43469
Josh-Cena merged 4 commits into
mdn:mainfrom
mohammed-ali-osman:add-css-api-accessibility

Conversation

@mohammed-ali-osman

Copy link
Copy Markdown
Contributor

Description

This PR adds an Accessibility section to the CSS Custom Highlight API page.

  • Summarizes the intended behavior from the specification: the type attribute can be used by user agents to expose semantic meaning (such as spelling or grammar errors) to assistive technologies.

  • Notes that current support is limited and inconsistent across browsers and platform accessibility APIs.

  • Provides guidance for developers: custom highlights should not be relied on alone to convey important information; semantic HTML elements like <mark> or additional accessible cues should be used when highlighting conveys meaning.

This update ensures that developers are aware of accessibility limitations and helps prevent assumptions about screen reader support.

Fixes #43408

Documents the intended behavior of the API's `type` attribute for assistive technologies,
and notes current limitations and inconsistent support across browsers.
@mohammed-ali-osman
mohammed-ali-osman requested a review from a team as a code owner March 17, 2026 11:22
@mohammed-ali-osman
mohammed-ali-osman requested review from chrisdavidmills and removed request for a team March 17, 2026 11:22
@github-actions github-actions Bot added Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed labels Mar 17, 2026
@github-actions

github-actions Bot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

@Josh-Cena
Josh-Cena requested a review from a team as a code owner August 11, 2026 21:29
@Josh-Cena
Josh-Cena requested review from sideshowbarker and removed request for a team August 11, 2026 21:29
@Josh-Cena

Copy link
Copy Markdown
Member

@chrisdavidmills I'd be happy to review this but I'm not sure if this section is in the correct place. What's the standard practice for documenting a11y in APIs with CSS?

@chrisdavidmills

Copy link
Copy Markdown
Contributor

@chrisdavidmills I'd be happy to review this but I'm not sure if this section is in the correct place. What's the standard practice for documenting a11y in APIs with CSS?

This is interesting. "Accessibility" sections are well-established in the HTML and CSS sections, but I don't think I've ever worked on one in the API section before.

Grepping around the site, I can see 4 such sections in existence:

We probably ought to add these sections to the API templates at some point. I think the heading should always be "Accessibility", for consistency. In terms of placement:

  • In reference pages, any "Accessibility" section should always go just before the "Examples" section (or the "Specifications" section if no "Examples" section exists).
  • In API landing pages, the "Accessibility" section should be put as a subsection inside "Concepts and usage"

Again, for consistency.

Which is all to say, I think the placement in this case is correct.

@Josh-Cena Josh-Cena left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you

@Josh-Cena
Josh-Cena merged commit 8a10694 into mdn:main Aug 12, 2026
9 checks passed
@mohammed-ali-osman
mohammed-ali-osman deleted the add-css-api-accessibility branch August 13, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document accessibility considerations for Custom Highlight API

4 participants