Skip to content

Conversation

@querkmachine
Copy link
Member

Closes #5255.

Changes

Organisation colour settings

  • Removed legacy organisation colour map.
  • Removed $govuk-new-organisation-colours feature flag.
  • Removed logic to change default value of $govuk-colours-organisations global depending on the feature flag.
  • Removed test ensuring that legacy 'websafe' colours passed WCAG Level AA's minimum contrast criterion against white.

govuk-organisation-colour function

  • Removed deprecation message shown when using the legacy palette.
  • Removed $websafe function parameter.
  • Removed deprecation message shown when using the $websafe parameter.
  • Removed code mapping the $websafe function parameter to the newer $contrast-safe parameter.
  • Removed all tests relating to the legacy palette.

@github-actions
Copy link

github-actions bot commented Oct 31, 2025

Other changes to npm package

diff --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

@querkmachine querkmachine self-assigned this Oct 31, 2025
@github-actions
Copy link

github-actions bot commented Oct 31, 2025

📋 Stats

No changes to any distributed file sizes!


Action run for c7cc0e1

@querkmachine querkmachine force-pushed the remove-old-org-colours branch from 6e669c4 to bb5adca Compare October 31, 2025 17:39
@querkmachine querkmachine marked this pull request as ready for review October 31, 2025 17:42
querkmachine and others added 5 commits November 3, 2025 14:18
- 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
Co-authored-by: seaemsi <[email protected]>
@querkmachine querkmachine force-pushed the remove-old-org-colours branch from 864f644 to c7cc0e1 Compare November 3, 2025 14:19
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-6390 November 3, 2025 14:19 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.

Code looks good

@querkmachine querkmachine merged commit 8eae3cf into main Nov 3, 2025
45 checks passed
@querkmachine querkmachine deleted the remove-old-org-colours branch November 3, 2025 15: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.

Remove the legacy organisation list, colour palette and $websafe parameter

5 participants