-
Notifications
You must be signed in to change notification settings - Fork 348
Warn if Sass is compiled using libsass #5993
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
Conversation
📋 StatsFile sizes
Modules
View stats and visualisations on the review app Action run for d0067a4 |
Other changes to npm packagediff --git a/packages/govuk-frontend/dist/govuk/settings/_index.scss b/packages/govuk-frontend/dist/govuk/settings/_index.scss
index e46fb4637..9cbf2779d 100644
--- a/packages/govuk-frontend/dist/govuk/settings/_index.scss
+++ b/packages/govuk-frontend/dist/govuk/settings/_index.scss
@@ -20,4 +20,17 @@
@import "https://github.com/links";
+// LibSass evaluates this as a single unquoted string, equivalent to
+// "true == false", whereas Dart Sass evaluates it as "true" == "false".
+// Because a string in Sass is truthy, LibSass will output the warning; Dart
+// Sass will not.
+@if #{true} == #{false} {
+ @include _warning(
+ "libsass",
+ "It looks like you may be using LibSass to compile your Sass. LibSass is " +
+ "deprecated and will not be supported by the next major version of " +
+ "GOV.UK Frontend. See https://sass-lang.com/libsass/ for more information."
+ );
+}
+
/*# sourceMappingURL=_index.scss.map */
Action run for d0067a4 |
CHANGELOG.md
Outdated
|
|
||
| ### New features | ||
|
|
||
| #### You'll see a deprecation warning if you're using LibSass |
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.
It feels a bit weird to list this as a new feature, but I didn't want to list it as a deprecation because the deprecation happened ages ago.
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.
Could we think of it as a fix, perhaps? Like, "we probably should've been warning you about this ages ago"? It does feel weird as a feature.
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.
Possibly, but we tend not to include any detail for fixes. I'm not sure it matters that much as long as we're telling people so they know when they start seeing this in their logs.
@seaemsi do you have any thoughts on the best way to communicate this?
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.
@36degrees Perhaps something like "you'll now see a deprecation warning" to highlight that there wasn't one before?
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.
@seaemsi sounds good, thanks. Are you happy with it being listed as a 'new feature'?
domoscargin
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.
Looks good to me once the conflict is sorted.
Make use of a difference in behaviour between compilers originally identified in #5918 to ‘detect’ if the Sass is being compiled using libsass. Output a deprecation warning if it is.
Make use of a difference in behaviour between compilers originally identified in #5918 to ‘detect’ if the Sass is being compiled using libsass. Output a deprecation warning if it is.