Jump to main content

Links are used to embed actions or pathways to more information, allowing users to click their way from page to page.

Default

Default links are a color defined by the current theme.

Soft

The .p-link--soft class uses the default text colour instead of link colour, and should be used on hyperlinks where many links are grouped together, such as a link cloud.

Dark

Links fully support the theming class names and will change colour based on the theme of their parent container.

Inverted

Deprecated

Inverted links are deprecated. Standard links in dark theme should be used instead.

When links are surrounded by regular, non-clickable text on backgrounds dark lighter than #2d2d2d, where it is impossible to obtain a blue colour that simultaneously has 3:1 contrast with surrounding white text, and at the same time, 4.5:1 contrast with the background (as per WCAG rule 1.4.11), for example on top of gradients or photographs, use the .p-link--inverted class.

Back to top

The .p-top link can be used to make it easier to go back to the top on long pages. If the page is divided into different sections, you can use more than one per page.

The .p-link--skip link is used to help keyboard users navigate quickly to the main content of a page. It should be the first element that can be tabbed to on any page, and should reference either the <main> landmark region element, or the ID of an element that contains the main content of the page.

Import

To import just this component into your project, copy the snippet below and include it in your main Sass file.

// import Vanilla and include base mixins
// this only needs to happen once in a given project
@import 'vanilla-framework';
@include vf-base;

@include vf-p-links;

For more information see Customising Vanilla in your projects, which includes overrides and importing instructions.

React

You can use links in React by installing our react-component library and importing Link component.

See the documentation for our React Link component