Breadcrumb separators are focusable

Created on 13 February 2025, 3 months ago

Problem/Motivation

The breadcrumb separators are focusable with for example the VoiceOver cursor, Claro has this problem as well ( πŸ› Breadcrumb separators are focusable with the voiceover cursor and get also announced Active ), while Olivero is unaffected and behaves correctly (check breadcrumb_separator_announcement.mp4 - in the first round i’ve used tab in the second round ctrl shift arrow right).

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

Steps to reproduce

  • Go to admin/config/regional/date-time, and with in my case voiceover, actively step through the breadcrumb trail by pressing VO-arrow right

Proposed resolution

  • Either Gin is using the underlying functionality in Claro then fix the linked issue and retest after the issue is fixed, if Gin has its own solution in this context, fix it within Gin and orient to the solution Olivero uses.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

4.0

Component

User interface

Created by

πŸ‡©πŸ‡ͺGermany rkoller NΓΌrnberg, Germany

Live updates comments and jobs are added and updated live.
  • Accessibility

    It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @rkoller
  • πŸ‡³πŸ‡±Netherlands batigolix Utrecht

    The situation is different for Gin, Claro and Olivero:

    Gin uses the "/" character as content of the ::before pseudo element in its css:

    .gin-breadcrumb__item + .gin-breadcrumb__item::before {
      content: "/";
      opacity: .3;
      font-size: var(--gin-font-size-xs);
      vertical-align: middle;
      display: inline-block;
      padding: 0 .5em;
      background: none;
    }

    /themes/contrib/gin/dist/css/components/breadcrumb.css

    Claro uses an svg as content of the ::before pseudo element in its css:
    https://eleven.ddev.site/core/themes/claro/css/components/breadcrumb.css...

    .breadcrumb__item + .breadcrumb__item::before {
      display: inline-block;
      padding: 0 0.75rem;
      content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' height='8' width='5'%3e%3cpath fill='currentColor' d='M1.207.647L.5 1.354 3.146 4 .5 6.647l.707.707L4.561 4z'/%3e%3c/svg%3e");
    }
    

    /core/themes/claro/css/components/breadcrumb.css

    Olivero has an empty ::before pseudo element in its css, but creates the separator by rotating borders :) :

    .breadcrumb__item:nth-child(n + 2)::before {
      display: inline-block;
      width: 0.5rem;
      height: 0.5rem;
      margin-inline: 1rem 1.25rem;
      content: "";
      transform: rotate(45deg); /* LTR */
      border-block-start: 2px solid var(--color--gray-45);
      border-inline-end: 2px solid var(--color--gray-45);
    }
    

    /core/themes/olivero/css/components/breadcrumb.css

    I think we can conclude that the Claro and Gin issues are separate (though related) and that a separate issue is need for Claro

    As for the possible solutions: Gin can use the method from Olivero, reemoving the content and using a (rotated) border, or an alternative text can be defined for the content property https://developer.mozilla.org/en-US/docs/Web/CSS/content#image_combined_... &&
    https://dev.to/whitep4nth3r/hide-text-in-css-pseudo-elements-from-screen...

    I'll have a look at the latter to see if there are any drawbacks.

  • πŸ‡³πŸ‡±Netherlands batigolix Utrecht

    So actually, there is a couple of approaches possible:

    - it can be done like in Oliveiro using CSS borders and transforming them. See the Olivero CSS example above
    - it can be left like it is now because the separator is visible and the screen reader pronounces it so the behaviour is the same for both experiences. But one could also argue that the screen reader already knows that this is a list so an extra separator is redundant.
    - another option is to add an alternative text in the CSS, but I would not prefer that because that means having content in the CSS files and that may open a new can of (multilingual) worms
    - I also had a quick look at how other websites solve this and for example on the MDN website is using a mask-image property for a separator image. See for example https://developer.mozilla.org/en-US/docs/Web/CSS :

    .breadcrumbs-container li .breadcrumb:after {
        background-color: var(--icon-secondary);
        content: "";
        display: block;
        flex-shrink: 0;
        height: 12px;
        margin-right: .5rem;
        -webkit-mask-image: url(/static/media/chevron.05a124d379047e16d746.svg);
        mask-image: url(/static/media/chevron.05a124d379047e16d746.svg);
        -webkit-mask-size: 12px;
        mask-size: 12px;
        transform: rotate(-90deg);
        width: 12px
    }
    
  • πŸ‡³πŸ‡±Netherlands batigolix Utrecht
  • πŸ‡³πŸ‡±Netherlands batigolix Utrecht

    Claro is facing the same problem: πŸ› Breadcrumb separators are focusable with the voiceover cursor and get also announced Active

    The solution in that ticket is to follow what Olivero does.

  • πŸ‡³πŸ‡±Netherlands batigolix Utrecht

    I made the necessary CSS changes so that the same solution as Olivero is being used

Production build 0.71.5 2024