Skip to content

[Deque Analysis] Avoid using "text_muted", as it has insufficient color contrast on a white background #1154

@tdonohue

Description

@tdonohue

Deque Analysis Summary

The text_muted style is used in a number of scenarios, and it's contrast is insufficient on a white background. A few of the scenarios where it is used include:

  • Displays of objects in lists...often the displayed non-Title metadata (e.g. date, authors, etc) uses text_muted.
  • Placeholder text in input fields use text_muted.

The contrast error is common in all these scenarios:

"Element has insufficient color contrast of 2.99 (foreground color: #959595, background color: #ffffff). Contrast must be 4.5 or more."

  1. Search Results (9 tickets)
  2. Header Search box / Login module (2 ticket)
    • (on all pages)
    • Locations: Placeholder text in search box & in email/password of login field use text_muted
    • Deque issue ticket IDs: 469254, 469332
  3. Browse by Comm/Coll (1 ticket)
  4. Homepage (3 tickets)
    • https://demo7.dspace.org/home
    • Locations: Placeholder text in search box, and Community/Collection descriptions use text_muted
    • Deque issue ticket IDs: 469553, 469470, 469471
  5. Submission (16 tickets)
    • https://demo7.dspace.org/submit
    • Locations:
      • Drag & drop files text (at top)
      • Hint text under all fields
      • Placeholder text in input fields
      • Labels/hints for edit file name/description (after uploading a file)
      • File size (KB/MB) text next to any uploaded files
    • Deque issue ticket IDs: 469504, 469507, 469509, 469511, 469513, 469515, 469517, 469520, 469522, 469523, 469525, 469527, 469529, 469530, 469977, 470000, 470006
  6. Collection homepage (5 tickets)
  7. Community homepage (2 tickets)
  8. Edit Collection (1 ticket )
  9. MyDSpace (18 tickets)

Recommended Fix

As discussed in recent meetings, we may want to move away from using text_muted at all (and recommend against it in our style guide).

  • For text which is secondary (e.g. dates, author text), we may wish to use the secondary color & ensure it has proper color contrast on a white background (must be 4.5 or greater). This means that if we want the secondary color to remain gray, it may need to minimally be #757575. However, other secondary colors are welcome, provided it meets AA compliance (AAA is not required) using this tool: https://dequeuniversity.com/rules/axe/4.1/color-contrast?application=axeAPI
  • For placeholder text, Deque recommended considering making it italics rather than making it appear lighter via text_muted. However, obviously we should ensure once text is typed in the box, it is no longer in italics.

More Information / Tools

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions