Skip to content

[a11y] Fix overlapping inline code background in headings - #90

Merged
danielguillan merged 4 commits into
mainfrom
danielguillan/a11y-fix-overlapping-heading-background
Feb 10, 2026
Merged

[a11y] Fix overlapping inline code background in headings#90
danielguillan merged 4 commits into
mainfrom
danielguillan/a11y-fix-overlapping-heading-background

Conversation

@danielguillan

@danielguillan danielguillan commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

Fixes https://github.com/github/accessibility-audits/issues/15032

Adjusts inline <code> styling within headings to prevent background overlap on wrapped headings.

The solution is to consider the entire code element for the headings' line height and to add a small block margin.

Before After
screenshot-UMZv3hoc-000728@2x screenshot-s0UkbWsk-000729@2x

@danielguillan
danielguillan requested a review from a team as a code owner February 9, 2026 15:52
Copilot AI review requested due to automatic review settings February 9, 2026 15:52

Copilot AI 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.

Pull request overview

Fixes an accessibility styling issue where inline <code> inside headings visually overlaps adjacent heading text when the heading wraps onto multiple lines.

Changes:

  • Updates .Prose heading inline-code styles to better participate in line layout and avoid overlap.
  • Adds a changeset for a patch release of @primer/doctocat-nextjs.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/theme/css/prose.module.css Adjusts inline <code> styling specifically within headings to prevent background overlap on wrapped headings.
.changeset/quiet-readers-refuse.md Records the patch-level change for release notes/versioning.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/theme/css/prose.module.css Outdated
line-height: 1;
vertical-align: baseline;
margin-block: var(--base-size-4);
box-decoration-break: clone;

Copilot AI Feb 9, 2026

Copy link

Choose a reason for hiding this comment

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

box-decoration-break: clone only affects fragmented inline boxes; with display: inline-block the element typically won’t fragment across lines, so this property may be ineffective. Consider either removing box-decoration-break or switching display to an inline value that can fragment (if the intent is per-line background/padding when the <code> content itself wraps).

Suggested change
box-decoration-break: clone;

Copilot uses AI. Check for mistakes.
Comment thread packages/theme/css/prose.module.css
Comment thread packages/theme/css/prose.module.css Outdated
Comment on lines +193 to +194
line-height: 1;
vertical-align: baseline;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Mostly curious... are these doing anything specific? They don't seem to do anything when you disable them but I'm probably missing something.

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.

These are mostly safeguards to ensure the code pill’s height stays predictable and doesn’t increase unexpectedly if the heading or future code styles use a different/larger line-height. I think it's ok to remove these for now.

@rezrah rezrah left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

Image

@danielguillan
danielguillan merged commit 402470e into main Feb 10, 2026
10 checks passed
@primer primer Bot mentioned this pull request Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants