Links navigate to other pages or additional information.
Use underlined links in most cases.
<a href="#" class="mds-link">Link Text</a>
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.
<a href="#" class="mds-link mds-link--no-underline">Link Text</a>
mds-link
class or mixin to an element other than <a>
.href
attribute for a link.aria-label
should be clear and concise, using fewer than 100 characters will increase user comprehension.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.aria-label
, including the file-type and file-size.aria-label
.<a>
element.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.aria-label
text in all caps. Most screen readers read all cap text one letter at a time.aria-label
, include “Morningstar Developer Site”.aria-label
. These symbols are not recognized by most assistive technology.
Class |
Applies to |
Outcome |
---|---|---|
|
Any link element |
Adds default, visited, hover, and focus styles to a link. |
|
|
Removes the underline from link styles. |
|
|
Prevents visited styles from being applied after a link is visited. |
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;
}