WebAIM - Web Accessibility In Mind

E-mail List Archives

Compliance requirements for highlighted text

for

From: megha patangi
Date: Sep 30, 2024 1:40AM


Hello Web Aim team,

I have a use case where there is a table grid possibly with thousands of
rows, and there is a search mechanism to filter down the table content.
When a key term is typed in the search box, hit enter, we get search
results minimizing the rows, where any one of the columns may contain that
key term, and the same will be highlighted. Means if row 2 cell three has
that key term, then row 3 cell 5 has and so on, it will be highlighted
visually. This is just to visually map the filtered results, nothing more
than that.

In HTML we are using a 'mark' tag so the screen reader while navigating in
browse mode is able to identify it.
For highlighted text with its background, contrast ratio is more than 3:1,
and no additional visual clue is present.

Intent of SC 1.4.1 Use of color, says,
"If content is conveyed through the use of colors that differ not only in
their hue, but that also have a significant difference in lightness, then
this counts as an additional visual distinction, as long as the difference
in relative luminance between the colors leads to a contrast ratio of 3:1
or greater."

Alternatively it also says,
"However, if content relies on the user's ability to accurately perceive or
differentiate a particular color an additional visual indicator will be
required regardless of the contrast ratio between those colors. For
example, knowing whether an outline is green for valid or red for invalid."

As per first intent it seems we are good as ratio is more than 3:1, but
then what is the other part talking about?
In the above use case do we really need any additional visual clue to
identify highlighted terms, or are we good and compliant?

Regards,
Megha