Skip to content

VIS-003b Make a link in running text stand out from the words around it by more than colour

Level
Rule
Verdict
Requirement
Status
proposed, version 1.0.0

Rule

A link in running text stands out from the words around it at rest, not only on hover or focus: by a cue that is not colour, such as an underline, or by 3:1 lightness against the surrounding text. Justified's tokens close the 3:1 route, so a cue is needed; our own choice is an underline.

Examples

Live examples built with Justified's components. Try them with the mouse, the keyboard or a screen reader.

Do: An underlined link in a paragraph

Lesson 3: Reading a balance sheet

Before the next lesson, read the chapter once. Download the worksheet for this lesson and bring your answers on Thursday.

Measuring …
The link is text-primary underline underline-offset-4. It differs from the words around it by little in lightness, and it does not matter: the underline is there at rest. Tab to it to see focus.

Don't: A link with only its colour

Lesson 3: Reading a balance sheet

Measuring …
A drawing of the same paragraph with text-primary alone. Tailwind removes the underline from every link, so the link is the same shape as the words around it, and the colour gap is far under 3:1.

Do: An underlined link in help text

Shown on certificates. Read how we use your name.

Measuring …
Under Display name, the last sentence of the help line is an underlined link. Help text is running text too.

Don't: An underline only on hover

Display name

Maya Okafor
Measuring …
A drawing with text-primary hover:underline. Move the pointer over the link and the underline appears, but only for someone who already found it. It is a drawing, so it has no keyboard path. The readout is taken at rest.

Why

A link that differs from its sentence only by hue is invisible to many people who see colours differently, and hard to find for anyone on a dim or glaring screen. They read past it and never learn it was there. WCAG 2.2, 1.4.1 Use of Color covers it, because "this word is a link" is information. The Working Group's failure F73 fails a link in text that only its colour sets apart, even if an underline appears on hover or focus, since nobody hovers over words they cannot find. Its technique G183 shows the other route: 3:1 in lightness between the link and the text around it, while each still reaches 4.5:1 against the page under 1.4.3 Contrast (Minimum). In Justified that route is closed. primary, the link colour, measures about 2.2:1 against foreground in the light theme and 2.1:1 in the dark one, and even less against muted-foreground. We measure in both themes, as VIS-001 explains. So a link in Justified's body text meets the criterion only with a cue that is not colour, and the underline is the plain one.

Do

  • Underline every link in a sentence or paragraph. On a course platform's lesson page, "Download the worksheet for this lesson" sits in a paragraph as <a className="text-primary underline underline-offset-4">. Justified's Button variant="link" already has the underline.
  • Underline links in help text as well. Under the field Display name on a learner's settings page, the text-muted-foreground line "Shown on certificates. Read how we use your name." has its last sentence as an underlined link.
  • Put the underline in the shared mapping when Markdown or MDX renders the content, so every link in an article gets it, and not in each page by hand.
  • Give a Next.js or React Router Link inside text the same classes as any other link in text. The router does not add an underline.
  • Use a bottom border or a thicker underline if the design wants one, as long as it is visible at rest and is not only a change of colour.
  • Add a change on hover and focus, such as hover:decoration-2, as an extra. A link that already stands out at rest does not need it to meet the criterion, but it helps people see what they are about to press.
  • A product with its own link colour that differs from its text by 3:1 or more in lightness, with both at 4.5:1 on the page, meets the criterion without an underline. We still recommend one, because an underline does not depend on how well someone sees lightness. This is our own advice.
  • Bold also passes the criterion, as weight is not colour. We prefer the underline, since bold is also used for emphasis; our own choice.

Don't

  • Style a link in a paragraph, a FormDescription, an AlertDescription or a dialog's text with text-primary alone. Tailwind's base styles remove the underline from every a, so a bare link in text has none.
  • Use text-primary hover:underline in running text. The underline appears only for people who already found the link.
  • Copy no-underline from a navigation pattern into an article.
  • Rely on the focus ring (KBD-001) to show that a word is a link. It shows where focus is, not what is a link at rest.

Exceptions

  • Links the setting shows. A menu, a footer list, a table of contents, a list where every item is a link, or a card that is a link as a whole need no underline, though one is allowed. What a current-page marker in a menu needs is NAV-002b. A link that sits in the middle of other words, such as in a table cell next to plain text, counts as running text.
  • Visited links. A visited link may differ from an unvisited one by colour alone. Each colour still needs 4.5:1 against the page (VIS-001).
  • Links styled as buttons. A link drawn as a button is a button to the eye and is outside this rule.
  • Neighbouring rules. What a link says is TXT-003. Colour as the only sign elsewhere is VIS-003a, the wider rule; this narrower one comes first for links in text.

Verdict

Requirement. Only the judges decide; the expert witnesses are shown but do not vote. How verdicts work

Stances on VIS-003b
SourceRoleStancePage
WCAG 2.2LawRequires1.4.1 Use of Color
WCAG 2.2LawSupports1.4.3 Contrast (Minimum)
Material DesignJudge No position
Apple Human Interface GuidelinesJudge SupportsColor
Carbon Design SystemJudge SupportsLink: usage
Link: accessibility
GOV.UK Design SystemExpert witness SupportsLinks
Nielsen Norman GroupExpert witness SupportsGuidelines for Visualizing Links, by Jakob Nielsen

Each stance links to the page it rests on, read on the date in the source register. This page never repeats what a source says; read the source itself.

History

  • Version 1.0.0, : First version.

Last checked against the other rules for conflicts on .

More in Colour and motion: 11 rules and 0 guidelines · All rules