Claro Shortcuts star fails WCAG Use of Color and Non-text contrast

Created on 18 September 2020, over 4 years ago
Updated 20 January 2023, over 2 years ago

Problem

The shortcuts star icon doesn't satisfy WCAG Success Criteria 1.4.1 "Use of Color", or 1.4.11 "Non-text contrast".

  • The grey outline of the star is too faint. It has a contrast ratio of just 2.78:1 against the grey page background.
  • The yellow fill isn't sufficiently distinguishable from the transparent fill. The contrast between the yellow and the grey page background is 1.29:1.
  • The yellow-fill is the only indication of state. On it's own, it isn't a reliable signifier. Even if these did have good contrast in the full-colour situation, the state can still be difficult for some users to notice: users with a colour vision impairment, or other visual impairments, or who have adjusted the colour space in some way, or where the screen is overpowered by ambient light.
  • When a Windows high-contrast theme is used, the star remains the same colour. We cannot rely on either the grey outline or the yellow fill to be distinguishable from the page background, because we cannot know what the background colour will be.
  • The Star is missing entirely in IE 11 when a Windows High Contrast theme is used. It's a CSS background image, and it gets stripped out by the browser. Users cannot perceive, operate, or understand it; they likely won't know it's there at all.
๐Ÿ› Bug report
Status

Needs work

Version

10.1 โœจ

Component
Shortcutย  โ†’

Last updated 2 days ago

  • Maintained by
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada @jibran
Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States dyannenova

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

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada mgifford Ottawa, Ontario
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada mgifford Ottawa, Ontario

    My mistake on tagging this 131. I should have gotten back to Andrew on that sooner.

  • Assigned to kentr
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States kentr Durango, CO

    I'm going to try to move the MR forward a little.

    Adding Needs issue summary update because the IS mentions IE11 and AFAIK Drupal dropped support for IE11.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States kentr Durango, CO

    There were merge conflicts when updating the existing MR branch, so here's a new MR against 11.x.

    Some comments

    1. I went back to the non-concentric fill for the "remove" states as specified by @ckrina's comment #16.
    2. For the "add, hover" state, the previous MR had a solid fill for forced-colors: active.
      That wasn't in @ckrina's screenshots, and due to the + above the star in the Claro icons I wondered if it is necessary. So I left the fill empty for now as shown in the screenshots.
    3. Inside the CSS url() function, the SVG with a forced-colors: active media query embedded in a style element did not display the LinkText color as expected.
      However, there are many instances in core of using mask-image for forced-colors: active, so I went with that method.
    4. For the time being, I've put the same icons into both Claro and the shortcut module.
      I suggest creating a lower-priority followup to refine the shortcut module's icons since they'll appear on Olivero (which has different blues).

    These screenshots are from Mac Firefox in standard mode and with browser.display.document_color_use set to 2.

    Needs manual testing with & without forced-colors / WHCM. I will update the IS with details.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States kentr Durango, CO

    kentr โ†’ changed the visibility of the branch issue-3171726 to hidden.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States kentr Durango, CO

    kentr โ†’ changed the visibility of the branch 3171726-claro-shortcuts-star to hidden.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Have not reviewed but previously tagged for issue summary update

    Tried to cleanup what I assume are old tags.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States kentr Durango, CO

    I'm working on the IS update.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States kentr Durango, CO

    Updated the IS, included testing notes, and attached the screenshots that didn't save for #57.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States kentr Durango, CO

    Forgot to change status / remove IS update.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Before

    After

    Does appear to address the failure

    Waiting on a maintainer to make sure they're fine with the color change.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Actually see in #6 ckrina gave the thumbs up.

  • Issue was unassigned.
  • Status changed to Needs review 5 days ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States kentr Durango, CO

    @smustgrave I think the version here is different than what @ckrina was thumbing up in #6.

    There were several iterations. The latest before I worked on it had the "concentric" stars. I didn't use that version because of @ckrina's comment in #16 ๐Ÿ› Claro Shortcuts star fails WCAG Use of Color and Non-text contrast Needs work :

    Once zoomed, I do like the star inside the star emulating the radio styles, but at a smaller size (like the one we're using) it can look blurry or too "crowded". It would also introduce changes on the SVG depending on the size because a 2px spacing might be too much in smaller icons vs too small on the bigger ones, and I'd try to avoid that if possible. I think the contrast with the blue filled vs non-filled grey when it's not saved should be enough:

    My version is closest to @ckrina's screenshots in #16. I added the little "+" and "x" in the corners of the hover versions.

    Changed back to NR just in case.

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany rkoller Nรผrnberg, Germany

    hm that is odd, i've tested MR11498 in Edge with high contrast mode on macos sequoia, the star in the screenshot in #58 ๐Ÿ› Claro Shortcuts star fails WCAG Use of Color and Non-text contrast Needs work looks okay to me, but in my own testing the star is barely visible in each of the two states.

    unchecked:

    checked:

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany rkoller Nรผrnberg, Germany

    Followup for #68 ๐Ÿ› Claro Shortcuts star fails WCAG Use of Color and Non-text contrast Needs work . The reason why the two star states were barely visible was my usage of the "enable automatic dark mode" setting in the edge rendering tab. Even though it uses also prefers-color-scheme: dark it is still behaving off. @kentr and I had a discussion and some further digging over in: https://drupal.slack.com/archives/C2ANFUGGG/p1746978093222529

    We still dont know the exact reason why the "enable automatic dark mode" setting is behaving differently output wise, but the following pen @kentr created illustrates the behaviro pretty well between the two approaches: https://codepen.io/kentr/full/XJJyerz (...and narrows down the cause to the color-scheme property as the key factor) . enable automatic dark mode on the left and prefers-color-scheme: dark on the right.

    the color-scheme property is not used in core so far (only gin uses it in a few places). therefore the suggestion for the way forward would be two fold, to open up a followup issue adding something like

    :root {
      color-scheme: light dark;
    }
    

    to core in general as suggested in the almanac on css tricks ( https://css-tricks.com/almanac/properties/c/color-scheme/). that way all elements of the page/site get opted into both color schemes making those elements theme-able in the forced color mode. and for testing avoid "enable automatic dark mode" nevertheless, instead use the following two settings (here in microsoft edge)


    And the star looks good with prefers-color-scheme: dark as well as all the available page color themes available. The only small nitpick i might have and i just noticed last night, in forced color mode the unchecked star border is yellow and the checked star is filled yellow. while in none forced color mode the checked star is blue which is in line with the forced color mode, since the color blue stands for links. but the unchecked star border is black / gray.

    so i wonder shouldnt the star in the unchecked state also have a blue border for consistency and semantics?

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States kentr Durango, CO

    RE #69

    Looking into Automatic Dark Mode further, my take is that the feature is just buggy. AFAICT, these are issues for it. It also appears to still be in a dev stage.

    The only small nitpick i might have and i just noticed last night, in forced color mode the unchecked star border is yellow and the checked star is filled yellow. while in none forced color mode the checked star is blue which is in line with the forced color mode, since the color blue stands for links. but the unchecked star border is black / gray.
    ...
    so i wonder shouldnt the star in the unchecked state also have a blue border for consistency and semantics?

    This is a good point. I was trying to follow @ckrina's colors in #16. Does this change need designer approval?

Production build 0.71.5 2024