Links

Links navigate to other pages or additional information.

Variations

Default (Underlined)

Use underlined links in most cases.

Default
Hover
Focus
Visited
<a href="#" class="mds-link">Link Text</a>
  • Use in body text, ordered, and unordered lists.
  • Never use when horizontal rules separate multiple links, i.e., Data Tables and List Groups. Instead, use the no underline link.

No Underline

Use to avoid visual clutter. No-underline links don't meet all accessibility benchmarks, so MDS is evaluating alternatives. In the interim, teams can still use no-underline links in production.

Default
Hover
Focus
Visited
<a href="#" class="mds-link mds-link--no-underline">Link Text</a>
  • Never use in body text, ordered ,and unordered lists. Instead, use the default (underlined) link.
  • Always use in cases where horizontal rules separate multiple links, i.e., Data Tables and List Groups.
  • Use when a link is paired with an icon that affords interaction, i.e., an expandable section with a caret icon.
  • Never display a visited state for links in List Groups or as titles of expandable sections.

Guidelines

Use When

  • Leading a user to another page.
  • Signaling email functionality by styling the address itself.

Don’t Use When

  • Submitting or confirming an action. Instead, use a Button.

Visual Language

Do use no underline links in Data Tables.
Do use no underline links in Data Tables.
Don‘t use underlined links.
Don‘t use underlined links.
Do use no underline links in List Groups.
Do use no underline links in List Groups.
Don‘t use underlined links.
Don‘t use underlined links.
Do use no underline links when paired with an icon that affords interaction, i.e., an expandable section with a caret icon.
Do use no underline links when paired with an icon that affords interaction, i.e., an expandable section with a caret icon.
Don‘t use underlined links.
Don‘t use underlined links.

Behaviors

  • Always open links in the same window unless requirements dictate otherwise, for example:
    • Opening a PDF document.
    • When opening a link in the same window will interrupt a user’s workflow.

Editorial

Accessibility

  • Never apply the mds-link class or mixin to an element other than <a>.
  • Always include focus styles for a link.
  • Always include an href attribute for a link.
  • An aria-label should be clear and concise, using fewer than 100 characters will increase user comprehension.
  • An aria-label should make sense out of context and clearly inform a user of what action will be taken if the link is selected. Don't rely on surrounding context to inform link content.
  • For links that activate a download, explicitly state this action within the aria-label, including the file-type and file-size.
  • For links that force the user to leave the current window or tab, explicitly state this action within the aria-label.
  • Combine adjacent image and text links into the same <a> element.
  • Don't use redundant wording within ARIA labels. An aria-label on an anchor tag automatically informs the user an element is a link. Words such as, “link”, “links”, or “go to” are repetitive and unnecessary.
  • Don't write aria-label text in all caps. Most screen readers read all cap text one letter at a time.
  • Don't embed critical information within CSS. Screen readers do not recognize CSS.
  • Never use URLs in link text, screen readers dictate URLs letter by letter. Instead of including developer.morningstar.com in the aria-label, include “Morningstar Developer Site”.
  • Never use dashes, mathematical characters or emoticons in place of the actual word within an aria-label. These symbols are not recognized by most assistive technology.

<a href="#" aria-label="Opportunity plus Instinct equals Profit"></a>

Do use words in place of mathematical characters.

<a href="#" aria-label="Opportunity + Instinct = Profit"></a>

Don‘t use mathematical characters in place of words.

<a href="#" aria-label="16 to 17 years"></a>

Do spell out the word “to” when referring to a timeframe.

<a href="#" aria-label="16 – 17 years"></a>

Don‘t use non-text symbols to format timeframes.

<a href="#" aria-label="Portfolio Report Information from January 1st, 2018 to April 30th, 2018">Portfolio Report Information 1/1/18–4/30/18</a>

Do spell out the date.

<a href="#" aria-label="Portfolio Report Information 1/1/18–4/30/18">Portfolio Report Information 1/1/18–4/30/18</a>

Don‘t use non-text symbols to format dates or timeframes.

Code Reference

CSS Class References

Class
Applies to
Outcome

mds-link

Any link element

Adds default, visited, hover, and focus styles to a link.

mds-link--no-underline

mds-link

Removes the underline from link styles.

mds-link--no-visited

mds-link

Prevents visited styles from being applied after a link is visited.

Mixin Reference

Use this mixin to add link styles to any element. Set $underline to false to hide underlines. Set $visited-styles to false to prevent a color change after a link is visited.

@include mds-link($underline: true, $visited-styles: true)

When combining header typography heading and link mixins, always include the link mixin mds-link first. This avoids conflicting line-height declarations.

[.my-custom-style] {
    @include mds-link;
    @include mds-level-1-heading;
}
©2018 Morningstar, Inc. All rights reserved. Terms of Use