Revisions diff markers: enforce 24×24px minimum target size (WCAG 2.5.8)#77671
Conversation
t-hamano
left a comment
There was a problem hiding this comment.
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 |
|---|---|
![]() |
![]() |
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
|
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.movPseudo-element approachScreen.Recording.2026-04-27.at.10.39.19.PM.movOne 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. |
Yes, I have the same concern. Let's hear other contributors' opinions. |
|
Stronger designs for hover and selected marker states would probably help. Maybe the marker could scale a little on hover/selection? |
|
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; |
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? |
|
I’ve removed the |
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
t-hamano
left a comment
There was a problem hiding this comment.
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?
|
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? |
|
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. |
|
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! |
….8) (#77671) * Revisions diff markers: enforce 24×24px minimum target size * fix: remove minHeight style to prevent diff marker overlap
|
I just cherry-picked this PR to the wp/7.0 branch to get it included in the next release: 19c0148 |
|
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? |
|
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. |
|
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. |
|
Removing the buttons that make them navigation targets would also meet the requirements. |
|
What about links/anchors? |
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
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
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
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
|
It doesn't make a difference what type of target it is; the guidelines govern any target. |



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?
.revision-diff-markerscolumn from 12px to 24px.Testing Instructions
.revision-diff-markerbutton 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
Use of AI Tools
None