Components · Links

Inline link

An inline link is an underlined text link that flows within body copy, lists and UI text. The underline is its affordance, and it is never paired with icons.

How to add an inline link to a page. The file is components/css/inline-link.css.

Basic Usage

Link the shared stylesheet once per page. Never copy the rules into a page.

StepWhat to do
1. Link<link rel="stylesheet" href="/components/css/inline-link.css">. Both templates already have it.
2. MarkupA real <a href> with class="inline-link inline-link--medium" inside the text.
3. SizeChoose the size that matches the text around the link.
4. ColorThe same color as the text around the link: Primary (no class) in Primary text, inline-link--secondary in Secondary text, --tertiary in Tertiary text, --inverted on a dark surface.
5. IconsNone. For an icon use an Action link.


API

Classes

ClassUse
inline-linkThe link. Primary color, underlined.
inline-link--xlarge, --large, --medium, --smallSize.
inline-link--weight-medium, --boldWeight (any size). --small-bold is kept: Small and Bold.
inline-link--italicItalic style.
inline-link--reverseNo underline when enabled, underline on hover.
inline-link--secondary, --tertiaryColors for grey text.
inline-link--invertedFor a dark surface.

Things to know

  • Breakpoint: XLarge, Large and Medium change at 769px. The CSS does this by itself.
  • The color is the color of the text around the link: Primary (text-primary), --secondary in text-secondary text, --tertiary in text-tertiary text. The hover colors are text-action-primary-hover, text-action-secondary-hover and text-action-tertiary-hover.
  • Never add an icon: use an Action link.
  • The focus ring needs body.keyboard-nav, which the templates set on the first Tab press.
  • The [data-state] selectors do nothing outside the documentation pages.

CSS / Tailwind

The component is one CSS file, shared by every page. Link it, never copy it. The CSS below is read from the file the page links, so it is always what you see.

CSS (components/css/inline-link.css)