Skip to content

Update links to use custom properties to implement their different styles #6482

Description

@romaricpascal

What

Update the link mixins to use custom properties for swapping the colours between the different states (hover, active, visited,...):

  • investigate if link styles (success, error, muted, text, inverse) can simply override --govuk-link-colour, --govuk-link-hover-colour, --govuk-link-active-colour, --govuk-link-visited-colour, of if the link mixin needs local custom properties. We may want to pay particular attention to:
    • Focus style
    • Links wrapping a block of content where the default --govuk-link-colour may need to be used
  • If necessary update govuk-link-style-default to use local custom properties
  • Update the link styles to change the custom properties used by govuk-link-style-default instead of redefining rules for each pseudo selector

Why

Link styles require a lot of repetitive selectors for each state, by moving to custom properties, we should reduce the size of output CSS

Who needs to work on this

Developers

Who needs to review this

Developers

Done when

  • We've decided if link styles should use a local custom property or override the global ones
  • We've updated the govuk-link-style-... mixins to use custom properties

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
In progress 📝

Relationships

None yet

Development

No branches or pull requests

Issue actions