-
Notifications
You must be signed in to change notification settings - Fork 348
Remove legacy organisation colour palette #6390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Other changes to npm packagediff --git a/packages/govuk-frontend/dist/govuk/helpers/_colour.scss b/packages/govuk-frontend/dist/govuk/helpers/_colour.scss
index 95291bc21..3d1f91827 100644
--- a/packages/govuk-frontend/dist/govuk/helpers/_colour.scss
+++ b/packages/govuk-frontend/dist/govuk/helpers/_colour.scss
@@ -85,7 +85,6 @@
/// Get the colour for a government organisation
///
/// @param {String} $organisation - Organisation name, lowercase, hyphenated
-/// @param {Boolean} $websafe - Deprecated. Use $contrast-safe instead.
/// @param {Boolean} $contrast-safe [true] - By default a version of the colour
/// will be returned which has a minimum 4.5:1 contrast ratio when used with
/// white, as per the WCAG 2.1 Level AA guidelines. If you want to use the
@@ -97,7 +96,7 @@
/// @throw if `$organisation` is not a known organisation
/// @access public
-@function govuk-organisation-colour($organisation, $websafe: null, $contrast-safe: true) {
+@function govuk-organisation-colour($organisation, $contrast-safe: true) {
// Check if the $organisation exists in the aliases map. If so, change the
// value of $organisation to the aliased value.
@if map-has-key($_govuk_colours-organisations-aliases, $organisation) {
@@ -109,50 +108,21 @@
@error "Unknown organisation `#{$organisation}`";
}
- // Output a deprecation warning if the legacy colour palette is being used.
- // Remove in next major version.
- $is-legacy: $govuk-colours-organisations == $_govuk-legacy-organisation-colours;
- @if $is-legacy and _should-warn("legacy-organisation-colours") {
- @warn _warning-text("legacy-organisation-colours",
- "We've updated the organisation colour palette. Opt in to the new " +
- "colours using `$govuk-new-organisation-colours: true`. The old " +
- "palette is deprecated and we'll remove it in the next major version."
- );
- }
-
- // Output a warning if $websafe is set.
- @if $websafe and _should-warn("organisation-colour-websafe-param") {
- @warn _warning-text("organisation-colour-websafe-param",
- "The `$websafe` parameter of `govuk-organisation-colour` has been " +
- "renamed to `$contrast-safe`. The old parameter name will be removed in " +
- "the next major version."
- );
- }
-
$org-colour: map-get($govuk-colours-organisations, $organisation);
- @if map-has-key($org-colour, deprecation-message) and _should-warn("organisation-colours") {
+ // If the organisation has a deprecation message associated with it
+ // (e.g. it has ceased to exist) then output a warning.
+ @if map-has-key($org-colour, "deprecation-message") and _should-warn("organisation-colours") {
@warn _warning-text(
"organisation-colours",
- map-get($org-colour, deprecation-message)
+ map-get($org-colour, "deprecation-message")
);
}
- // If the $websafe parameter is being used (it has been explicitly set as true
- // or false), assume the user hasn't updated to use $contrast-safe yet and map
- // the old parameter's value onto the new parameter.
- @if type-of($websafe) != "null" {
- $contrast-safe: $websafe;
- }
-
- // Determine the contrast-safe key to use depending on whether it's the new
- // palette or the legacy palette
- $safe-key: if($govuk-new-organisation-colours, "contrast-safe", "colour-websafe");
-
- @if $contrast-safe and map-has-key($org-colour, $safe-key) {
- @return map-get($org-colour, $safe-key);
+ @if $contrast-safe and map-has-key($org-colour, "contrast-safe") {
+ @return map-get($org-colour, "contrast-safe");
} @else {
- @return map-get($org-colour, colour);
+ @return map-get($org-colour, "colour");
}
}
diff --git a/packages/govuk-frontend/dist/govuk/settings/_colours-organisations.scss b/packages/govuk-frontend/dist/govuk/settings/_colours-organisations.scss
index 9b69d3594..3e7606c85 100644
--- a/packages/govuk-frontend/dist/govuk/settings/_colours-organisations.scss
+++ b/packages/govuk-frontend/dist/govuk/settings/_colours-organisations.scss
@@ -4,20 +4,7 @@
/// @group settings/colours
////
-/// Feature flag for updated organisation list and colours
-///
-/// When set to true, $govuk-colours-organisations will use the new
-/// organisation list and colour selection.
-///
-/// Should be removed in 6.0.
-///
-/// @type Boolean
-/// @access public
-/// @deprecated Using new organisation colours will become the default in Frontend v6.0.
-
-$govuk-new-organisation-colours: false !default;
-
-/// Current organisation colours
+/// Organisation colour palette
///
/// @type Map
///
@@ -27,12 +14,12 @@ $govuk-new-organisation-colours: false !default;
/// white, to be used for copy and meet the AAA (large text) and AA (smaller
/// copy) WCAG guidelines.
/// @prop $organisation.deprecation-message - Marks this organisation as
-/// deprecated (usually because it has ceased to exist). Value is the
-/// deprecation message output to the terminal when compiling.
+/// deprecated (usually because it has ceased to exist). The value is the
+/// deprecation message output to the terminal when compiling Sass.
///
-/// @access private
+/// @access public
-$_govuk-organisation-colours: (
+$govuk-colours-organisations: (
"attorney-generals-office": (
colour: #a91c8e
),
@@ -199,165 +186,7 @@ $_govuk-organisation-colours: (
"wales-office": (
colour: #a33038
)
-);
-
-/// Legacy organisation colours
-///
-/// These are the colours included with Frontend prior to 5.3.0. They will be
-/// removed in a future major version of Frontend.
-///
-/// @type Map
-///
-/// @prop $organisation.colour - Colour for the given `$organisation`
-/// @prop $organisation.colour-websafe - Optional alternative shade of the
-/// organisation colour. Despite the name, is not guaranteed to be websafe
-/// nor provide better contrast than the base colour.
-///
-/// @access private
-/// @deprecated Migrate to using the new organisation colour palette instead.
-
-$_govuk-legacy-organisation-colours: (
- "attorney-generals-office": (
- colour: #9f1888,
- colour-websafe: #a03a88
- ),
- "cabinet-office": (
- colour: #005abb,
- colour-websafe: #347da4
- ),
- "civil-service": (
- colour: #af292e
- ),
- "department-for-business-innovation-skills": (
- colour: #003479,
- colour-websafe: #347da4
- ),
- "department-for-communities-local-government": (
- colour: #009999,
- colour-websafe: #37836e
- ),
- "department-for-culture-media-sport": (
- colour: #d40072,
- colour-websafe: #a03155
- ),
- "department-for-education": (
- colour: #003a69,
- colour-websafe: #347ca9
- ),
- "department-for-environment-food-rural-affairs": (
- colour: #00a33b,
- colour-websafe: #008938
- ),
- "department-for-international-development": (
- colour: #002878,
- colour-websafe: #405e9a
- ),
- "department-for-international-trade": (
- colour: #cf102d,
- colour-websafe: #005ea5
- ),
- "department-for-business-trade": (
- colour: #cf102d,
- colour-websafe: #005ea5
- ),
- "department-for-levelling-up-housing-communities": (
- colour: #012169
- ),
- "department-for-transport": (
- colour: #006c56,
- colour-websafe: #398373
- ),
- "department-for-work-pensions": (
- colour: #00beb7,
- colour-websafe: #37807b
- ),
- "department-of-energy-climate-change": (
- colour: #009ddb,
- colour-websafe: #2b7cac
- ),
- "department-of-health": (
- colour: #00ad93,
- colour-websafe: #39836e
- ),
- "foreign-commonwealth-development-office": (
- colour: #012169
- ),
- "foreign-commonwealth-office": (
- colour: #003e74,
- colour-websafe: #406e97
- ),
- "government-equalities-office": (
- colour: #9325b2
- ),
- "hm-government": (
- colour: #0076c0,
- colour-websafe: #347da4
- ),
- "hm-revenue-customs": (
- colour: #009390,
- colour-websafe: #008670
- ),
- "hm-treasury": (
- colour: #af292e,
- colour-websafe: #832322
- ),
- "home-office": (
- colour: #9325b2,
- colour-websafe: #9440b2
- ),
- "ministry-of-defence": (
- colour: #4d2942,
- colour-websafe: #5a5c92
- ),
- "ministry-of-justice": (
- colour: #231f20,
- colour-websafe: #5a5c92
- ),
- "northern-ireland-office": (
- colour: #002663,
- colour-websafe: #3e598c
- ),
- "office-of-the-advocate-general-for-scotland": (
- colour: #002663,
- colour-websafe: #005ea5
- ),
- "office-of-the-leader-of-the-house-of-commons": (
- colour: #317023,
- colour-websafe: #005f8f
- ),
- "office-of-the-leader-of-the-house-of-lords": (
- colour: #9c132e,
- colour-websafe: #c2395d
- ),
- "scotland-office": (
- colour: #002663,
- colour-websafe: #405c8a
- ),
- "uk-export-finance": (
- colour: #005747,
- colour-websafe: #005ea5
- ),
- "uk-trade-investment": (
- colour: #c80651,
- colour-websafe: #005ea5
- ),
- "wales-office": (
- colour: #a33038,
- colour-websafe: #7a242a
- )
-);
-
-/// Set public organisation colours variable to one of the two maps.
-/// Users can also pass their own map to this to override it entirely.
-///
-/// @type Map
-/// @access public
-
-$govuk-colours-organisations: $_govuk-legacy-organisation-colours !default;
-
-@if $govuk-new-organisation-colours and $govuk-colours-organisations == $_govuk-legacy-organisation-colours {
- $govuk-colours-organisations: $_govuk-organisation-colours;
-}
+) !default;
/// Organisation colour aliases
///
Action run for c7cc0e1 |
📋 StatsNo changes to any distributed file sizes! Action run for c7cc0e1 |
6e669c4 to
bb5adca
Compare
seaemsi
reviewed
Nov 3, 2025
24dfd4e to
864f644
Compare
- Remove legacy colour palette map - Remove feature flag - Remove code to switch palettes based on the feature flag
- Remove the $websafe parameter - Remove mapping of $websafe to $contrast-safe parameters - Remove deprecation warnings for using $websafe or legacy colour palette
and $websafe parameter
Co-authored-by: seaemsi <[email protected]>
864f644 to
c7cc0e1
Compare
owenatgov
approved these changes
Nov 3, 2025
Contributor
owenatgov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #5255.
Changes
Organisation colour settings
$govuk-new-organisation-coloursfeature flag.$govuk-colours-organisationsglobal depending on the feature flag.govuk-organisation-colourfunction$websafefunction parameter.$websafeparameter.$websafefunction parameter to the newer$contrast-safeparameter.