Problem/Motivation

Several interface components don't meet the minimum target size of 24 by 24 pixels (SC2.5.8 - purple dots label focusable elements not meeting the success criterion while green dots label the compliance). The components affected are:

  • Links (all links not constrained by line-height of non-target text)
  • Radio buttons
  • Form element labels
  • the account settings page with the radio buttons and the labels and the inline links with a purple dots in the background while all the rest of the focusable elements have a green dot

  • Grid/table (in add or select media dialog modal)
  • the add or select media dialog modal in light mode with the grid table toggle switch button and the labels with purple dots in the background while the rest of the focusable elements have green dots

  • Cog button (for example on the manage form display page)
  • the manage form display page in light mode and the cog icons, the show row weight link and the breadcrumbs have purple dots in the background while all the rest of the focusable elements have green dots

  • Drop buttons (in the CKEditor toolbar)
  • the ckeditor toolbar, the field label as well as the drop button with a purple dort while the rest of the icons have a green dot in the background

…and there might be more.

Discussed and iterated on the issue with @mgifford, @the_g_bomb, @katannshaw, and @drupa11y

Steps to reproduce

Proposed resolution

  • There is already an issue for dealing with target sizes in Claro (#3491461: [meta] Some interface components don’t meet the minimum target size) but due to the fact that the issues listed on the aforementioned list apply only to a subset of components in Gin, because the styling differs between the two themes, it makes probably sense to solve those target size issues within Gin separately to Claro. (*the changes not necessarily entail layout changes, often adding some more padding is enough)

Remaining tasks

User interface changes

API changes

Data model changes

Comments

rkoller created an issue. See original summary.

mgifford’s picture

Project: Gin Admin Theme » Drupal core
Version: 4.0.2 » 11.2.x-dev
Component: User interface » ajax system

Moving this to Drupal Core as this affects most of Drupal. Gin's moving into Core, but the base problem isn't Gin.

rkoller’s picture

Could you please move it back to gin ( i dont have the permissions to move issues in between projects). this issue is specific about gin and some of the interface components only available in gin. as mentioned in the proposed resolution there is also #3491461: [meta] Some interface components don’t meet the minimum target size for claro and core in general.

mgifford’s picture

Just wanted to say that the images at the top came from the Basic Target Size Highlighter from:
https://accessibility-tools.github.io/target-size-highlighter/

There are reasons to use either the basic or Advanced Bookmarklet for this.

To see the outline more clearly in a Chrome Inspector, we can add:

a,
button,
input,
[role="button"],
[role="link"] {
  outline: 2px dashed red !important;
}

To ensure all buttons/links/icons have a minimum clickable size, can't we do something like:

a, button, input, .icon-button, .dropbutton__toggle {
  position: relative;
  min-width: 24px;
  min-height: 24px;
}

a {
  padding: 10px 15px;
  display: inline-block;
}

I like this idea for mobile devices (but that is a AAA SC at this point):

@media (hover: none) and (pointer: coarse) {
  button {
    min-width: 48px;
    min-height: 48px;
    margin: 10px;
  }
}

More on some of these from:
https://allyship.dev/blog/click-target-size

Nice to see Craft CMS aiming for AAA and 44px:

mgifford’s picture

mgifford’s picture

Just looking at more info around strategies for this.

In terms of how we are addressing this:

https://tetralogical.com/blog/2022/12/20/foundations-target-size/

the Target Size (Minimum) criterion is perhaps misleading. It won't guarantee that there are no small targets. It defines an ideal minimum size, but also allows an exception for smaller targets with sufficient spacing. The intent of the criterion is not to make sure targets are large enough to be comfortably activated, but to avoid having targets that are too small clustered closely together, which would otherwise increase the likelihood of a person accidentally activating an adjacent target.

Some exceptions to the rule:

https://dubbot.com/dubblog/2024/staying-on-target.html

It is also important to take into consideration the exceptions to WCAG 2.5.8, which are:

  • If smaller targets (less than 24 x 24 CSS pixels) are arranged so that, when a 24 CSS pixel diameter circle is centered on each target's bounding box, the circles don't overlap with other targets or their circles.
  • Equivalent: The function can be achieved through a different control on the same page that meets this criterion. For instance, in the following screenshot, the targets in the upper right corner are 15px with no minimum spacing, while the ones further down the page are 24px with no minimum spacing. Therefore, the criterion has been met.
  • Inline: The target is in a sentence, or its size is otherwise constrained by the line height. For example, contextual links may be constrained by the vertical spacing between lines of text or the leading.
    • User-agent control: The size of the target is determined by the user agent and is not modified by the author. For example:
    • the options list of
      dropdowns
    • date picker for the HTML date input
    • color picker for the HTML color input
  • Essential: A particular presentation of the target is essential or is legally required for the information being conveyed. For example, the target must be a certain size or shape.

Some other good guidance from Eric Bailey https://www.smashingmagazine.com/2024/07/getting-bottom-minimum-wcag-con... and Adrian Roselli

quietone’s picture

Version: 11.2.x-dev » 11.x-dev

In Drupal core changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies. Thanks

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.