Skip to content

Conversation

@romaricpascal
Copy link
Member

@romaricpascal romaricpascal commented Oct 13, 2025

Adds the brand colours in a private $_govuk-palette variable and updates govuk-colour to allow access to the brand colours through the use of their $colour name and $variant name in the palette.

Current govuk-colour call using only one parameter are automatically translated:

  • if the $colour exists in the brand palette , return the primary variant
  • if the $colour does not exist in the brand palette, return an equivalent colour from the palette

Thoughts

The new palette has been made private to discourage people from editing or overriding it, so it remains a source of truth for the colours provided by GOV.UK Frontend.

Fixes #6327

@romaricpascal romaricpascal changed the title Remove legacy parameter from govuk-colour Use brand palette through govuk-colour Oct 13, 2025
@github-actions

This comment was marked as off-topic.

@github-actions

This comment was marked as off-topic.

@github-actions
Copy link

github-actions bot commented Oct 13, 2025

📋 Stats

No changes to any distributed file sizes!


Action run for 5822b9b

@romaricpascal romaricpascal changed the title Use brand palette through govuk-colour [WIP] Use brand palette through govuk-colour Oct 13, 2025
@romaricpascal romaricpascal force-pushed the govuk-colour-for-brand branch from c9c156f to 31fcaff Compare October 14, 2025 10:06
@romaricpascal romaricpascal force-pushed the govuk-colour-for-brand branch from 42b7374 to 2fe49c2 Compare October 14, 2025 10:37
@romaricpascal romaricpascal force-pushed the govuk-colour-for-brand branch from 2fe49c2 to ff2d069 Compare October 14, 2025 10:42
@romaricpascal romaricpascal changed the title [WIP] Use brand palette through govuk-colour Use brand palette through govuk-colour Oct 14, 2025
@romaricpascal romaricpascal marked this pull request as ready for review October 14, 2025 11:11
@domoscargin
Copy link
Contributor

Warning

The Percy visual changes STILL NEED REVIEW

Percy had some kind of blip and didn't detect changes. We then pushed again, and Percy now doesn't detect any difference between the current snapshots and the ones it approved because it didn't detect the changes.

So now it's auto-approved the snapshots, despite correctly identifying that they differ from the base.

Manual review needed!

@domoscargin
Copy link
Contributor

In the interests of avoiding a massive PR, I wonder if we could explore splitting this one up somehow.

If we have no internal uses of $legacy, for example, we could split 69da672 into it's own thing.

Similarly, maybe split da935c5 and ebb1b12 into their own "adding the palette" PR and then the rest as a sort "using the new palette" PR?

I can't remember exactly how interconnected each commit was, but it'd be nice to have smaller PRs.

@mia-allers-gds
Copy link

@romaricpascal I checked this page with all components and it looks ok!

@romaricpascal
Copy link
Member Author

Dreamy! Cheers @mia-allers-gds. Once we've added a CHANGELOG we can merge it 😊

romaricpascal and others added 7 commits October 17, 2025 17:26
It was deprecated and will not be in v6.0

Co-authored-by: domoscargin <[email protected]>
Co-authored-by: Owen Jones <[email protected]>
Add a separate palette for the brand colours, including all tints and shades.
The palette is marked as private to encourage access through `govuk-colour`
and not to modify it.

Tests check that the right variants are present for each colour,
so we don't mistakenly remove a variant.

Co-authored-by: domoscargin <[email protected]>
Co-authored-by: Owen Jones <[email protected]>
Includes looking up a fallback colour for colours that don't exist in the brand palette (like `light-grey`).

Co-authored-by: domoscargin <[email protected]>
Co-authored-by: Owen Jones <[email protected]>
Offer the corresponding replacement in the warning

Co-authored-by: domoscargin <[email protected]>
Co-authored-by: Owen Jones <[email protected]>
Co-authored-by: domoscargin <[email protected]>
Co-authored-by: Owen Jones <[email protected]>
The palette is no longer used
@romaricpascal romaricpascal force-pushed the govuk-colour-for-brand branch from 2de694d to 38dcab4 Compare October 17, 2025 16:32
Copy link
Contributor

@owenatgov owenatgov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything's looking good.

The only thing this is missing is the heading on removing the legacy param from the release notes doc (internal), since this PR also does that. If we can amend the lasty commit to add that then I think we're good.

@romaricpascal romaricpascal force-pushed the govuk-colour-for-brand branch from 1f8d1ef to 5822b9b Compare October 20, 2025 11:43
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-6326 October 20, 2025 11:43 Inactive
Copy link
Contributor

@owenatgov owenatgov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's get it rolling baybeeeee

@romaricpascal romaricpascal merged commit 7585548 into main Oct 20, 2025
49 checks passed
@romaricpascal romaricpascal deleted the govuk-colour-for-brand branch October 20, 2025 14:40
@romaricpascal romaricpascal restored the govuk-colour-for-brand branch November 7, 2025 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update govuk-colour to use the new palette

6 participants