The default icon for field types with no icon assigned has a too low color contrast

Created on 18 June 2025, 28 days ago

Problem/Motivation

The default icon, in case a field type has not assigned an icon, has a too low color contrast with 1.5:1 (#cacbd2 against #f3f4f9 - WCAG 2.2 SC1.4.11). See the Mermaid diagram field type example:

We've discussed the problem in the weekly Drupal CMS a11y track meeting today. For the record the attendees were, @katannshaw, @rkoller, and @the_g_bomb

Steps to reproduce

Proposed resolution

Even though it is a generic icon that doesn't provide any visual cue about the type of field nor is it possible to distinguish two or more field types that are using that default icon, but meeting the minimum color contrast requirement of 3:1, makes sure that the icon is at least visible for more people.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Version

11.0 🔥

Component

field system

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.

  • Field UX

    Usability improvements related to the Field UI

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @rkoller
  • 🇮🇳India virag.jain

    virag.jain made their first commit to this issue’s fork.

  • 🇮🇳India virag.jain

    You're absolutely right that the current default icon used for field types without specific icons lacks sufficient color contrast.

    I support updating the default icon styling to meet the minimum contrast requirement. A simple change to the icon's fill color would go a long way in improving accessibility without impacting the overall design.

    I'll provide a patch shortly to update the default field type icon styling so it meets the minimum 3:1 contrast ratio per WCAG 2.2 SC 1.4.11. This will ensure better visibility and accessibility for all users, even when no specific icon is assigned to a field type.

    Looking forward to your feedback once the patch is up.

  • 🇮🇳India virag.jain

    virag.jain changed the visibility of the branch 3530862-the-default-icon to hidden.

  • 🇮🇳India virag.jain

    virag.jain changed the visibility of the branch 3530862-the-default-icon to active.

  • 🇮🇪Ireland lostcarpark

    I'm working on this.

  • Merge request !12413Make puzzle piece same shade as other icons. → (Open) created by lostcarpark
  • Pipeline finished with Success
    27 days ago
    Total: 592s
    #526262
  • 🇮🇪Ireland lostcarpark

    I have made the puzzle piece the same colour as the other core icons. The new one is in the core/misc/icons/55565b directory.

    The original version remains in the core/misc/icons/cacbd2 directory. I'm not sure if it should be removed.

    Moving to needs review.

  • 🇩🇪Germany rkoller Nürnberg, Germany

    thanks @lostcarpark! that looks good, going with the same color like the rest of the icons is definitely fixing the color contrast issue (it has a contrast of 6.7:1 now). the only thing i wonder, was it the intention by going with a lighter grey for the default icon to differentiate from the bespoke ones so it "stands out" somehow? I have no strong opinion either way as long as the contrast is meeting the minimum requirement.

    about the question if the original version should be removed, definitely a valid question, but i dont know. i would assume it would make sense to clean that up if it is not needed anywhere else anymore.

  • 🇮🇪Ireland lostcarpark

    I can't see how having the default icon a lighter color conveys any useful information to anyone except the maintainer of the module providing the field. If anything, it might make people think the field type is unavailable.

    However, if anyone feels strongly that it should be a lighter shade, I can certainly find a color that gives sufficient contrast.

    It's also worth noting that the Gin theme seems to override the default color for all icons, so in Gin the placeholder is a dark color by default, and a light color in dark mode.

    I've searched the core codebase, and there are no other references to the puzzle_piece_placeholder.svg file, so I agree it makes sense to remove it.

  • Pipeline finished with Success
    27 days ago
    Total: 1466s
    #526434
  • 🇮🇪Ireland lostcarpark

    Updated to remove the old version of the puzzle piece icon.

  • 🇩🇪Germany rkoller Nürnberg, Germany

    i not necessarily meant that the icon color should be lighter. i was just thinking out loud if there was some intention behind the lighter color choice for the default icon . but strictly speaking, if some information would be conveyed via a different color that would be against SC1.4.1, therefore a +1 for the consistent colors you've went with from my end. and i've also discussed that question in todays accessibility office hour with @katanshaw and @the_g_bomb and both agreed as well. overall this looks good to go imho. not sure if it would be ok for me to rtbc the issue, since i've opened it. maybe wait for a second opinion, but a +1 for RTBC from my end.

  • 🇩🇪Germany rkoller Nürnberg, Germany

    updated the user interface changes section in the issue summary (uploaded another screenshot so the before and after are both in a dialog modal.

  • 🇩🇪Germany rkoller Nürnberg, Germany
  • 🇪🇸Spain pierregermain

    We have tested using gitpod (drupal 11.3-dev) the MR and we have found a contrast of 6.66:1 using

  • 🇮🇳India divya.sejekan

    Verified using MR!12413 , The contrast ratio of the icon's stroke color (#55565b) against the parent's background color (rgb(243, 244, 249)) is 6.67:1. This meets the WCAG AA standard for normal text (4.5:1) and large text (3:1).

    Icon looks fine in Gin (light & dark), Claro theme. Attaching claro theme before and after screenshots

    Steps Followed :
    1. Install Drupal
    2. In Content type , Navigate to Manage fields , Add fields
    3. Check the field type icons.

    RTBC+ , Keeping in ' Need Review ' for Further code review

  • 🇺🇸United States mherchel Gainesville, FL, US

    This looks great.

    Tested with geolocation module.

  • Pipeline finished with Failed
    2 days ago
    Total: 604s
    #546962
Production build 0.71.5 2024