Open hellogreg opened 1 year ago
This could be represented in docs if we aren't changing the color value with the components/link#interaction-states
Thoughts @coreyvickery?
Psuedo code example: (implementation would differ based on inside a component vs on general page)
a {
color: var(--_link-color, var(--rh-color-accent-base-on-light, #0066cc));
text-decoration: var(--_link-decoration, none);
}
.dark a {
--_link-color: var(--rh-color-accent-base-on-dark, #73bcf7);
--_link-decoration: underline;
}
Do we need to fix this in tokens prior to 1.0? See also #869
@bennypowers No, something so small doesn't need to hold up 1.0.
@zeroedin Makes sense to me, Marionne or I can update the documentation when we're ready to jump back into working on ux dot again.
@hellogreg We'll probably go with adding an underline for dark theme as Steven outlined.
Describe the bug
By default, inline links in dark contexts are 1) not underlined (except when hovered/focused), and 2) do not have 3:1 color contrast from their surrounding paragraph text.
This is a failure of WCAG criterion 1.4.1: Use of color.
Frank Taylor first brought this up in the RHDS chat, resulting from this Red Hat Jira issue.
Which Component?
n/a
Steps to reproduce
Expected behaviour
The link text should either 1) be underlined by default (pre-hover/focus), or 2) have 3:1 color contrast from the surrounding text (current fail) and also have a visual enhancement, like an underline, upon hover and focus (current pass). All normal-sized text must still meet or exceed 4.5:1 contrast from the background, too.
Screenshots
No response
Element HTML
No response
Operating System (OS)
macOS
Browser
Chrome
More browser information
Chrome 110
Additional Info
The tricky part of this may not be just a matter of picking a link color that contrasts with the non-link text. But it has to do so while keeping its sufficient color contrast against all backgrounds, too! The "dark" context could be especially tough.
Honestly, the easiest thing to do may just be to underline the inline links--at least in dark contexts.