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

Fix or suppress Dart Sass deprecation warnings #3192

Merged
merged 3 commits into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions src/govuk/components/tag/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,47 +35,47 @@
}

.govuk-tag--grey {
color: govuk-shade(govuk-colour("dark-grey", $legacy: "grey-1"), 30);
background: govuk-tint(govuk-colour("dark-grey", $legacy: "grey-1"), 90);
color: govuk-shade(govuk-colour("dark-grey", $legacy: "grey-1"), 30%);
background: govuk-tint(govuk-colour("dark-grey", $legacy: "grey-1"), 90%);
}

.govuk-tag--purple {
color: govuk-shade(govuk-colour("purple"), 20);
background: govuk-tint(govuk-colour("purple"), 80);
color: govuk-shade(govuk-colour("purple"), 20%);
background: govuk-tint(govuk-colour("purple"), 80%);
}

.govuk-tag--turquoise {
color: govuk-shade(govuk-colour("turquoise"), 60);
background: govuk-tint(govuk-colour("turquoise"), 70);
color: govuk-shade(govuk-colour("turquoise"), 60%);
background: govuk-tint(govuk-colour("turquoise"), 70%);
}

.govuk-tag--blue {
color: govuk-shade(govuk-colour("blue"), 30);
background: govuk-tint(govuk-colour("blue"), 80);
color: govuk-shade(govuk-colour("blue"), 30%);
background: govuk-tint(govuk-colour("blue"), 80%);
}

.govuk-tag--yellow {
color: govuk-shade(govuk-colour("yellow"), 65);
background: govuk-tint(govuk-colour("yellow"), 75);
color: govuk-shade(govuk-colour("yellow"), 65%);
background: govuk-tint(govuk-colour("yellow"), 75%);
}

.govuk-tag--orange {
color: govuk-shade(govuk-colour("orange"), 55);
background: govuk-tint(govuk-colour("orange"), 70);
color: govuk-shade(govuk-colour("orange"), 55%);
background: govuk-tint(govuk-colour("orange"), 70%);
}

.govuk-tag--red {
color: govuk-shade(govuk-colour("red"), 30);
background: govuk-tint(govuk-colour("red"), 80);
color: govuk-shade(govuk-colour("red"), 30%);
background: govuk-tint(govuk-colour("red"), 80%);
}

.govuk-tag--pink {
color: govuk-shade(govuk-colour("pink"), 40);
background: govuk-tint(govuk-colour("pink"), 80);
color: govuk-shade(govuk-colour("pink"), 40%);
background: govuk-tint(govuk-colour("pink"), 80%);
}

.govuk-tag--green {
color: govuk-shade(govuk-colour("green"), 20);
background: govuk-tint(govuk-colour("green"), 80);
color: govuk-shade(govuk-colour("green"), 20%);
background: govuk-tint(govuk-colour("green"), 80%);
}
}
7 changes: 5 additions & 2 deletions src/govuk/helpers/_colour.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/// Get colour
///
/// @param {String} $colour - Name of colour from the colour palette
/// @param {String | Colour} $colour - Name of colour from the colour palette
/// (`$govuk-colours`)
/// @param {String} $legacy - Either the name of colour from the legacy palette
/// or a colour literal, to return instead when in 'legacy mode' - matching
Expand Down Expand Up @@ -36,7 +36,10 @@
$colour: $legacy;
}

$colour: quote($colour);
@if type-of($colour) == "color" {
// stylelint-disable-next-line scss/function-quote-no-quoted-strings-inside
$colour: quote("#{$colour}");
}

@if not map-has-key($govuk-colours, $colour) {
@error "Unknown colour `#{$colour}`";
Expand Down
3 changes: 3 additions & 0 deletions tasks/compile-stylesheets.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ export async function compileStylesheet ([modulePath, { srcPath, destPath }]) {
file: moduleSrcPath,
outFile: moduleDestPath,

// Turn off dependency warnings
quietDeps: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whilst this PR fixes govuk-frontend deprecation warnings we add quietDeps: true to ignore:

govuk_frontend_toolkit
govuk-elements-sass

See https://frontend.design-system.service.gov.uk/importing-css-assets-and-javascript/#silence-deprecation-warnings-from-dependencies-in-dart-sass


// Enable source maps
sourceMap: true,
sourceMapContents: true,
Expand Down