close
Skip to content

Revisions diff markers: enforce 24×24px minimum target size (WCAG 2.5.8)#77671

Merged
joedolson merged 2 commits into
WordPress:trunkfrom
R1shabh-Gupta:fix/revisions-diff-marker-min-target-size
May 12, 2026
Merged

Revisions diff markers: enforce 24×24px minimum target size (WCAG 2.5.8)#77671
joedolson merged 2 commits into
WordPress:trunkfrom
R1shabh-Gupta:fix/revisions-diff-marker-min-target-size

Conversation

@R1shabh-Gupta
Copy link
Copy Markdown
Contributor

What?

Part of #77530

Ensures revision diff marker buttons meet the WCAG 2.5.8 minimum target size of 24×24 CSS pixels.

Why?

Diff marker buttons in the revisions can shrink to as small as 12px by 4px, which falls well below the WCAG 2.5.8 minimum target size of 24 × 24 pixels.

How?

  1. Increase the width of the .revision-diff-markers column from 12px to 24px.
  2. Add minHeight: '24px' to the button’s inline style.

Testing Instructions

  1. Open a post or page with at least two saved revisions.
  2. Open the Revisions panel from the editor toolbar.
  3. Inspect any .revision-diff-marker button in DevTools. Computed width should be 24px and computed height should be at least 24px, regardless of how small the corresponding block is in the document.

Screenshots or screencast

Before After
Screenshot 2026-04-25 at 8 10 38 PM Screenshot 2026-04-25 at 8 08 32 PM

Use of AI Tools

None

@github-actions github-actions Bot added the [Package] Editor /packages/editor label Apr 25, 2026
@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Feature] History History, undo, redo, revisions, autosave. labels Apr 27, 2026
Copy link
Copy Markdown
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

Thanks for working on this!

I understand that increasing the button size is necessary from an accessibility perspective, but increasing the height may cause buttons to overlap. I'm concerned this might actually make it harder to read.

trunk This PR
Image Image

As an intermediate approach, how about using pseudo-elements?

.revision-diff-markers {
	.revision-diff-marker {
		// Expand the hit area to 24px without resizing the visible marker.
		&::before {
			content: "";
			position: absolute;
			inset: 0;
			min-height: 24px;
			top: 50%;
			transform: translateY(-50%);
		}

cc @joedolson @ellatrix @WordPress/gutenberg-design

@t-hamano t-hamano mentioned this pull request Apr 27, 2026
19 tasks
@R1shabh-Gupta
Copy link
Copy Markdown
Contributor Author

Hi @t-hamano, thanks for taking the time to review this PR.

I tested the pseudo-element approach and recorded a short comparison to make the differences clearer. For anyone from the design team following along, here is a side-by-side view of how both approaches behave visually:

Current implementation (24×24px minimum size)

Screen.Recording.2026-04-27.at.6.08.41.PM.mov

Pseudo-element approach

Screen.Recording.2026-04-27.at.10.39.19.PM.mov

One subtle issue I noticed with the pseudo-element approach is related to interaction. When two markers with small heights are close together, clicking in the space between them can sometimes trigger either marker, which may feel a bit unpredictable.

There is a slight visual difference in the selected marker’s color that helps indicate which one is active, so this may mitigate the issue to some extent. It is easier to notice in the video than to describe precisely, but it is another detail worth considering.

@t-hamano t-hamano added Needs Design Feedback Needs general design feedback. Needs Accessibility Feedback Need input from accessibility labels Apr 28, 2026
@t-hamano t-hamano requested review from a team and joedolson April 28, 2026 08:58
@t-hamano
Copy link
Copy Markdown
Contributor

One subtle issue I noticed with the pseudo-element approach is related to interaction. When two markers with small heights are close together, clicking in the space between them can sometimes trigger either marker, which may feel a bit unpredictable.

Yes, I have the same concern. Let's hear other contributors' opinions.

@jameskoster
Copy link
Copy Markdown
Contributor

Stronger designs for hover and selected marker states would probably help. Maybe the marker could scale a little on hover/selection?

@joedolson
Copy link
Copy Markdown
Contributor

An increase on hover state wouldn't solve the accessibility issue - the purpose of the minimum target size is to make it easier for users to place their pointer on the target, and if it only enlarges on :hover, then that goal isn't met. This type of concern is particularly for people with mobility issues that effect precision, like cerebral palsy, essential tremor, or parkinson's.

I think that the overlapping regions using pseudo-elements would have the same problem. The WCAG guideline requires that no other target can be within the 24x24 target circle, so overlapping regions would still be a problem, as it makes it difficult to hit the intended target.

It seems like it would be possible to prevent the buttons from overlapping by expanding the vertical scale to when necessary;

@t-hamano
Copy link
Copy Markdown
Contributor

It seems like it would be possible to prevent the buttons from overlapping by expanding the vertical scale to when necessary;

It's likely possible, but it might require complex logic to avoid button collisions. Note has such processing.

For the first improvement, how about widening only the width to 24px?

@R1shabh-Gupta
Copy link
Copy Markdown
Contributor Author

I’ve removed the minHeight styles as they were causing overlapping issues in some cases. For now, I’ve updated the implementation to widen only the width to 24px as a more conservative improvement.

@R1shabh-Gupta R1shabh-Gupta requested a review from t-hamano April 29, 2026 12:58
@R1shabh-Gupta R1shabh-Gupta marked this pull request as ready for review April 29, 2026 12:58
@github-actions
Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: R1shabh-Gupta <rishabhwp@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: jameskoster <jameskoster@git.wordpress.org>
Co-authored-by: joedolson <joedolson@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Copy Markdown
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

Personally, I think even just widening the width to 24px would be a significant improvement, and we could ship it like this for now. We might be able to address the button conflicts in a follow-up update. What do you think?

@R1shabh-Gupta
Copy link
Copy Markdown
Contributor Author

That sounds good to me. Widening the width to 24px feels like a good incremental improvement.

Just a quick check, would you prefer that I update the PR title and description to reflect the current scope?

@joedolson
Copy link
Copy Markdown
Contributor

Widening the width at least helps; it will still be a minimum well below the WCAG standards, however. That said, it's only possible for it to be that narrow, it's not a certainty.

It would be nice to see an improvement before 7.0 that at least prevented it from being below 24x24 as long as the space is available.

@joedolson
Copy link
Copy Markdown
Contributor

I'm merging this PR in; I think that this is a very important change, and although this doesn't 100% solve the problem, it will fix it in the majority of cases, and can be worked on incrementally after wards.

Thank you!

@joedolson joedolson merged commit f9d0fc0 into WordPress:trunk May 12, 2026
43 of 44 checks passed
@github-actions github-actions Bot added this to the Gutenberg 23.2 milestone May 12, 2026
@joedolson joedolson added the Backport to WP 7.0 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label May 12, 2026
@github-actions github-actions Bot removed the Backport to WP 7.0 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label May 12, 2026
gutenbergplugin pushed a commit that referenced this pull request May 12, 2026
….8) (#77671)

* Revisions diff markers: enforce 24×24px minimum target size

* fix: remove minHeight style to prevent diff marker overlap
@github-actions github-actions Bot added the Backported to WP Core Pull request that has been successfully merged into WP Core label May 12, 2026
@github-actions
Copy link
Copy Markdown

I just cherry-picked this PR to the wp/7.0 branch to get it included in the next release: 19c0148

@ellatrix
Copy link
Copy Markdown
Member

I don't like this change at all. Why can't we do something on focus? Plenty of applications have small ticks on in the scroll area for marking changes. Why do we have to be different?

@joedolson
Copy link
Copy Markdown
Contributor

Ticks for marking changes can be any size; ticks for navigating to changes need to meet specific WCAG guidelines covering target size. And yes, there are a lot of applications that fail those requirements - I don't see that as a reason to imitate them.

@ellatrix
Copy link
Copy Markdown
Member

These ticks are just a progressive enhancement, we already have the text diff just as before that should be navigable. I added these ticks as an extra, subtle, visual hint.

@joedolson
Copy link
Copy Markdown
Contributor

Removing the buttons that make them navigation targets would also meet the requirements.

@ellatrix
Copy link
Copy Markdown
Member

What about links/anchors?

pento pushed a commit to WordPress/wordpress-develop that referenced this pull request May 14, 2026
This updates the pinned hash from the `gutenberg` from `c15cef1d6b07f666df28dac0383bafb0edfe0914 ` to `3a4e8d1418d25da83b70158bcaabf65580690b6b`.

The following changes are included:

- [WP.7.0] Admin UI: Backport accessibility fixes (WordPress/gutenberg#77617, WordPress/gutenberg#78001) (WordPress/gutenberg#78002)
- Fix: Shortcode block does not render in Navigation Overlay (WordPress/gutenberg#77511)
- feat: Enhance Connectors page on read-only file system (WordPress/gutenberg#77521)
- Connectors: Avoid using centered text (WordPress/gutenberg#78125)
- Revisions: Add tooltip to diff marker buttons  (WordPress/gutenberg#77690)
- Add backport for WP_ALLOW_COLLABORATION (WordPress/gutenberg#78160)
- Add aria-label to Revisions button in Post Summary sidebar (WordPress/gutenberg#78140)
- Revisions diff markers: enforce 24×24px minimum target size (WCAG 2.5.8) (WordPress/gutenberg#77671)
- Connectors: Replace @wordpress/ui Link and Notice usage (WordPress/gutenberg#78117)
- Connectors: Increase right padding of callout for mobile layout (WordPress/gutenberg#78126)
- isFulfilled: don't change resolution state, call in resolveSelect (WordPress/gutenberg#78201)
- Connectors: Restyle AI plugin callout with pastel background and beaker decoration (WordPress/gutenberg#78243)
- Block supports: Optimize custom CSS class rendering and parsing (WordPress/gutenberg#78217)
- Block Inspector: Hide Styles tab in preview mode (WordPress/gutenberg#78230)
- Navigation Link: Preserve custom labels during link updates (WordPress/gutenberg#77186)
- Editor: Fix Visual Revisions meta keys overlap (WordPress/gutenberg#78156)
- Editor: Disable Visual Revisions when classic meta boxes are present (WordPress/gutenberg#78249) (WordPress/gutenberg#78286)
- Revisions: Scale diff markers width with user text-size preference (WordPress/gutenberg#78273)

A full list of changes can be found on GitHub: https://github.com/WordPress/gutenberg/compare/c15cef1d6b07f666df28dac0383bafb0edfe0914…3a4e8d1418d25da83b70158bcaabf65580690b6b.

Log created with:

git log --reverse --format="- %s" c15cef1d6b07f666df28dac0383bafb0edfe0914..3a4e8d1418d25da83b70158bcaabf65580690b6b | sed 's|#\([0-9][0-9]*\)|https://github.com/WordPress/gutenberg/pull/\1|g; /github\.com\/WordPress\/gutenberg\/pull/!d' | pbcopy

See #64595.

git-svn-id: https://develop.svn.wordpress.org/branches/7.0@62360 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request May 14, 2026
This updates the pinned hash from the `gutenberg` from `c15cef1d6b07f666df28dac0383bafb0edfe0914 ` to `3a4e8d1418d25da83b70158bcaabf65580690b6b`.

The following changes are included:

- [WP.7.0] Admin UI: Backport accessibility fixes (WordPress/gutenberg#77617, WordPress/gutenberg#78001) (WordPress/gutenberg#78002)
- Fix: Shortcode block does not render in Navigation Overlay (WordPress/gutenberg#77511)
- feat: Enhance Connectors page on read-only file system (WordPress/gutenberg#77521)
- Connectors: Avoid using centered text (WordPress/gutenberg#78125)
- Revisions: Add tooltip to diff marker buttons  (WordPress/gutenberg#77690)
- Add backport for WP_ALLOW_COLLABORATION (WordPress/gutenberg#78160)
- Add aria-label to Revisions button in Post Summary sidebar (WordPress/gutenberg#78140)
- Revisions diff markers: enforce 24×24px minimum target size (WCAG 2.5.8) (WordPress/gutenberg#77671)
- Connectors: Replace @wordpress/ui Link and Notice usage (WordPress/gutenberg#78117)
- Connectors: Increase right padding of callout for mobile layout (WordPress/gutenberg#78126)
- isFulfilled: don't change resolution state, call in resolveSelect (WordPress/gutenberg#78201)
- Connectors: Restyle AI plugin callout with pastel background and beaker decoration (WordPress/gutenberg#78243)
- Block supports: Optimize custom CSS class rendering and parsing (WordPress/gutenberg#78217)
- Block Inspector: Hide Styles tab in preview mode (WordPress/gutenberg#78230)
- Navigation Link: Preserve custom labels during link updates (WordPress/gutenberg#77186)
- Editor: Fix Visual Revisions meta keys overlap (WordPress/gutenberg#78156)
- Editor: Disable Visual Revisions when classic meta boxes are present (WordPress/gutenberg#78249) (WordPress/gutenberg#78286)
- Revisions: Scale diff markers width with user text-size preference (WordPress/gutenberg#78273)

A full list of changes can be found on GitHub: https://github.com/WordPress/gutenberg/compare/c15cef1d6b07f666df28dac0383bafb0edfe0914…3a4e8d1418d25da83b70158bcaabf65580690b6b.

Log created with:

git log --reverse --format="- %s" c15cef1d6b07f666df28dac0383bafb0edfe0914..3a4e8d1418d25da83b70158bcaabf65580690b6b | sed 's|#\([0-9][0-9]*\)|https://github.com/WordPress/gutenberg/pull/\1|g; /github\.com\/WordPress\/gutenberg\/pull/!d' | pbcopy

See #64595.
Built from https://develop.svn.wordpress.org/branches/7.0@62360


git-svn-id: http://core.svn.wordpress.org/branches/7.0@61641 1a063a9b-81f0-0310-95a4-ce76da25c4cd
pento pushed a commit to WordPress/wordpress-develop that referenced this pull request May 14, 2026
This updates the pinned hash from the `gutenberg` from `c15cef1d6b07f666df28dac0383bafb0edfe0914 ` to `3a4e8d1418d25da83b70158bcaabf65580690b6b`.

The following changes are included:

- [WP.7.0] Admin UI: Backport accessibility fixes (WordPress/gutenberg#77617, WordPress/gutenberg#78001) (WordPress/gutenberg#78002)
- Fix: Shortcode block does not render in Navigation Overlay (WordPress/gutenberg#77511)
- feat: Enhance Connectors page on read-only file system (WordPress/gutenberg#77521)
- Connectors: Avoid using centered text (WordPress/gutenberg#78125)
- Revisions: Add tooltip to diff marker buttons  (WordPress/gutenberg#77690)
- Add backport for WP_ALLOW_COLLABORATION (WordPress/gutenberg#78160)
- Add aria-label to Revisions button in Post Summary sidebar (WordPress/gutenberg#78140)
- Revisions diff markers: enforce 24×24px minimum target size (WCAG 2.5.8) (WordPress/gutenberg#77671)
- Connectors: Replace @wordpress/ui Link and Notice usage (WordPress/gutenberg#78117)
- Connectors: Increase right padding of callout for mobile layout (WordPress/gutenberg#78126)
- isFulfilled: don't change resolution state, call in resolveSelect (WordPress/gutenberg#78201)
- Connectors: Restyle AI plugin callout with pastel background and beaker decoration (WordPress/gutenberg#78243)
- Block supports: Optimize custom CSS class rendering and parsing (WordPress/gutenberg#78217)
- Block Inspector: Hide Styles tab in preview mode (WordPress/gutenberg#78230)
- Navigation Link: Preserve custom labels during link updates (WordPress/gutenberg#77186)
- Editor: Fix Visual Revisions meta keys overlap (WordPress/gutenberg#78156)
- Editor: Disable Visual Revisions when classic meta boxes are present (WordPress/gutenberg#78249) (WordPress/gutenberg#78286)
- Revisions: Scale diff markers width with user text-size preference (WordPress/gutenberg#78273)

A full list of changes can be found on GitHub: https://github.com/WordPress/gutenberg/compare/c15cef1d6b07f666df28dac0383bafb0edfe0914…3a4e8d1418d25da83b70158bcaabf65580690b6b.

Log created with:

`git log --reverse --format="- %s" c15cef1d6b07f666df28dac0383bafb0edfe0914..3a4e8d1418d25da83b70158bcaabf65580690b6b | sed 's|#\([0-9][0-9]*\)|https://github.com/WordPress/gutenberg/pull/\1|g; /github\.com\/WordPress\/gutenberg\/pull/!d' | pbcopy`

Reviewed by desrosj.
Merges [62360] to `trunk`.

See #64595.

git-svn-id: https://develop.svn.wordpress.org/trunk@62361 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request May 14, 2026
This updates the pinned hash from the `gutenberg` from `c15cef1d6b07f666df28dac0383bafb0edfe0914 ` to `3a4e8d1418d25da83b70158bcaabf65580690b6b`.

The following changes are included:

- [WP.7.0] Admin UI: Backport accessibility fixes (WordPress/gutenberg#77617, WordPress/gutenberg#78001) (WordPress/gutenberg#78002)
- Fix: Shortcode block does not render in Navigation Overlay (WordPress/gutenberg#77511)
- feat: Enhance Connectors page on read-only file system (WordPress/gutenberg#77521)
- Connectors: Avoid using centered text (WordPress/gutenberg#78125)
- Revisions: Add tooltip to diff marker buttons  (WordPress/gutenberg#77690)
- Add backport for WP_ALLOW_COLLABORATION (WordPress/gutenberg#78160)
- Add aria-label to Revisions button in Post Summary sidebar (WordPress/gutenberg#78140)
- Revisions diff markers: enforce 24×24px minimum target size (WCAG 2.5.8) (WordPress/gutenberg#77671)
- Connectors: Replace @wordpress/ui Link and Notice usage (WordPress/gutenberg#78117)
- Connectors: Increase right padding of callout for mobile layout (WordPress/gutenberg#78126)
- isFulfilled: don't change resolution state, call in resolveSelect (WordPress/gutenberg#78201)
- Connectors: Restyle AI plugin callout with pastel background and beaker decoration (WordPress/gutenberg#78243)
- Block supports: Optimize custom CSS class rendering and parsing (WordPress/gutenberg#78217)
- Block Inspector: Hide Styles tab in preview mode (WordPress/gutenberg#78230)
- Navigation Link: Preserve custom labels during link updates (WordPress/gutenberg#77186)
- Editor: Fix Visual Revisions meta keys overlap (WordPress/gutenberg#78156)
- Editor: Disable Visual Revisions when classic meta boxes are present (WordPress/gutenberg#78249) (WordPress/gutenberg#78286)
- Revisions: Scale diff markers width with user text-size preference (WordPress/gutenberg#78273)

A full list of changes can be found on GitHub: https://github.com/WordPress/gutenberg/compare/c15cef1d6b07f666df28dac0383bafb0edfe0914…3a4e8d1418d25da83b70158bcaabf65580690b6b.

Log created with:

`git log --reverse --format="- %s" c15cef1d6b07f666df28dac0383bafb0edfe0914..3a4e8d1418d25da83b70158bcaabf65580690b6b | sed 's|#\([0-9][0-9]*\)|https://github.com/WordPress/gutenberg/pull/\1|g; /github\.com\/WordPress\/gutenberg\/pull/!d' | pbcopy`

Reviewed by desrosj.
Merges [62360] to `trunk`.

See #64595.
Built from https://develop.svn.wordpress.org/trunk@62361


git-svn-id: http://core.svn.wordpress.org/trunk@61642 1a063a9b-81f0-0310-95a4-ce76da25c4cd
@joedolson
Copy link
Copy Markdown
Contributor

It doesn't make a difference what type of target it is; the guidelines govern any target.

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

Labels

Backported to WP Core Pull request that has been successfully merged into WP Core [Feature] History History, undo, redo, revisions, autosave. [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Needs Accessibility Feedback Need input from accessibility Needs Design Feedback Needs general design feedback. [Package] Editor /packages/editor [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants