-
Notifications
You must be signed in to change notification settings - Fork 334
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
querkmachine
wants to merge
1
commit into
main
Choose a base branch
from
deprecate-legacy-org-colours
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
govuk-design-system-ci
temporarily deployed
to
govuk-frontend-pr-5627
January 16, 2025 16:20
Inactive
📋 StatsFile sizes
Modules
View stats and visualisations on the review app Action run for 9503bb7 |
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 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 |
querkmachine
force-pushed
the
deprecate-legacy-org-colours
branch
from
January 16, 2025 16:22
be27105
to
9503bb7
Compare
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.
Deprecates the legacy organisation colour palette, which was replaced by an updated palette in 5.5.0.
Closes #5254.
Changes
$govuk-new-organisation-colours
in SassDoc.$_govuk-legacy-organisation-colours
, in SassDoc.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.