Skip to content
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

Deprecate legacy organisation colour palette #5627

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

querkmachine
Copy link
Member

@querkmachine querkmachine commented Jan 16, 2025

Deprecates the legacy organisation colour palette, which was replaced by an updated palette in 5.5.0.

Closes #5254.

Changes

  • Deprecates the feature flag $govuk-new-organisation-colours in SassDoc.
  • Deprecates the private variable that holds the legacy colours, $_govuk-legacy-organisation-colours, in SassDoc.
  • Updates govuk-organisation-colour to produce a warning if the legacy colour palette is being used.

Thoughts

I wasn't entirely sure about how best to perform the deprecation, as the feature flag is only used to alter the default value of the $govuk-colours-organisations.

@romaricpascal suggested changing the variable assignment to use Sass's @if/@else structure to set the variable instead, but doing this caused some tests to fail, seemingly because assignment to $govuk-colours-organisations wasn't happening consistently. I also wasn't sure whether having the same variable with the !default flag defined multiple times might induce side effects, so I left this as is.

Ultimately, I added code to the govuk-organisation-colour function to produce a warning if the $govuk-new-organisation-colours feature flag is false. This doesn't help if someone is accessing $govuk-colours-organisations directly (which isn't uncommon), but it seems like the best option available.

@querkmachine querkmachine self-assigned this Jan 16, 2025
Copy link

github-actions bot commented Jan 16, 2025

📋 Stats

File sizes

File Size
dist/govuk-frontend-development.min.css 118.41 KiB
dist/govuk-frontend-development.min.js 42.7 KiB
packages/govuk-frontend/dist/govuk/all.bundle.js 92.81 KiB
packages/govuk-frontend/dist/govuk/all.bundle.mjs 87.12 KiB
packages/govuk-frontend/dist/govuk/all.mjs 1.25 KiB
packages/govuk-frontend/dist/govuk/govuk-frontend-component.mjs 1.74 KiB
packages/govuk-frontend/dist/govuk/govuk-frontend.min.css 118.4 KiB
packages/govuk-frontend/dist/govuk/govuk-frontend.min.js 42.69 KiB
packages/govuk-frontend/dist/govuk/i18n.mjs 5.55 KiB
packages/govuk-frontend/dist/govuk/init.mjs 7.13 KiB

Modules

File Size (bundled) Size (minified)
all.mjs 82.57 KiB 40.4 KiB
accordion.mjs 26.58 KiB 13.41 KiB
button.mjs 9.09 KiB 3.78 KiB
character-count.mjs 25.39 KiB 10.9 KiB
checkboxes.mjs 7.81 KiB 3.42 KiB
error-summary.mjs 10.99 KiB 4.54 KiB
exit-this-page.mjs 20.2 KiB 10.34 KiB
header.mjs 6.46 KiB 3.22 KiB
notification-banner.mjs 9.35 KiB 3.7 KiB
password-input.mjs 18.24 KiB 8.33 KiB
radios.mjs 6.81 KiB 2.98 KiB
service-navigation.mjs 6.44 KiB 3.26 KiB
skip-link.mjs 6.4 KiB 2.76 KiB
tabs.mjs 12.04 KiB 6.67 KiB

View stats and visualisations on the review app


Action run for 9503bb7

Copy link

github-actions bot commented Jan 16, 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 287c371ab..aed8dc949 100644
--- a/packages/govuk-frontend/dist/govuk/helpers/_colour.scss
+++ b/packages/govuk-frontend/dist/govuk/helpers/_colour.scss
@@ -75,6 +75,14 @@
     );
   }
 
+  // Output a deprecation warning if using the legacy colour palette
+  @if not $govuk-new-organisation-colours and not index($govuk-suppressed-warnings, "legacy-organisation-colours") {
+    @warn _warning-text("legacy-organisation-colours",
+      "The legacy organisation colour palette has been deprecated and 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 not index($govuk-suppressed-warnings, "organisation-colours") {
diff --git a/packages/govuk-frontend/dist/govuk/settings/_colours-organisations.scss b/packages/govuk-frontend/dist/govuk/settings/_colours-organisations.scss
index 12f976a45..b0a6f378d 100644
--- a/packages/govuk-frontend/dist/govuk/settings/_colours-organisations.scss
+++ b/packages/govuk-frontend/dist/govuk/settings/_colours-organisations.scss
@@ -11,6 +11,7 @@
 ///
 /// @type Boolean
 /// @access public
+/// @deprecated Using new organisation colours will become the default in Frontend v6.0.
 
 $govuk-new-organisation-colours: false !default;
 
@@ -211,6 +212,7 @@ $_govuk-organisation-colours: (
 ///   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": (

Action run for 9503bb7

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.

Deprecate the legacy organisation list and colour palette
2 participants