Skip to content

Refactor print text styling to benefit from custom properties #6363

@romaricpascal

Description

@romaricpascal

What

Rather than outputting one media query per application of the govuk-text-colour mixin output a media query to set the colour of the text to black, use a single media query to change the colour of the text to black.

This may lead to the removal of the govuk-text-colour mixin.

Considerations:
Whether to start with black text and switch it for screen media, or start with off-black text and switch it for print media (likely dictated by how things would fail when custom properties are not supported).
Can we bluntly override --govuk-text-colour or do we need some nuance between:

  1. “the definition the colour of the text on screen for future reference”
  2. “applying a colour to the text”

At the moment, both are mixed in $govuk-text-colour, but if we override --govuk-text-colour and we meant it as (1), we’ve effectively lost the definition of the screen text colour.

Why

This will let us simplify our codebase as well as confirm our approach to custom properties provides the benefits we expect

Who needs to work on this

Developers

Who needs to review this

Developers

Done when

[ ] Swap between print and screen colour for text happens through a single media query rather than once per govuk-text-colour mixin

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Blocked ⛔

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions