Skip to content

Commit

Permalink
Document silencing deprecation warnings in Dart Sass
Browse files Browse the repository at this point in the history
We can't currently make the changes in GOV.UK Frontend to resolve the deprecation warnings without also removing support for compilers other than Dart Sass.

However, since Dart Sass 1.35 it's possible to silence deprecation warnings coming from dependencies.

Document how to do this, pointing to the relevant parts of the Sass docs for more information.

See alphagov/govuk-frontend#2238 for more details.
  • Loading branch information
36degrees committed Oct 5, 2021
1 parent 5002254 commit ffdb0b1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions source/importing-css-assets-and-javascript/index.html.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,23 @@ If you want to override GOV.UK Frontend's styles with your own styles, `@import`

If your project uses GOV.UK Frontend toolkit, GOV.UK Template or GOV.UK Elements, you can [configure GOV.UK Frontend to work with them](/compatibility-mode/).

### Silence deprecation warnings in Dart Sass

If you are using Dart Sass v1.33.0 or greater, you may see deprecation warnings when compiling your Sass:

```
DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.
```

We are currently unable to fix these deprecation warnings without breaking support for LibSass.

You can however silence the warnings. Ensure you are using Dart Sass 1.35.0 or greater and then:

- if you are calling the sass compiler from the command line, pass [the `--quiet-deps` flag](https://sass-lang.com/documentation/cli/dart-sass#quiet-deps)
- if you are using the JavaScript API, include [`quietDeps: true`](https://sass-lang.com/documentation/js-api#quietdeps) in the `options` object

This will only silence deprecation warnings that are caused by dependencies, including GOV.UK Frontend. You will still see deprecation warnings if you are using `/` for division in your own Sass code.

## Font and image assets

To use the font and image assets from GOV.UK Frontend, you can either:
Expand Down
2 changes: 2 additions & 0 deletions source/installing-with-npm/index.html.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ weight: 10

3. Install [Dart Sass](https://www.npmjs.com/package/sass) - version 1.0.0 or higher.

If you are using Dart Sass v1.33.0 or greater, you may see deprecation warnings when compiling your Sass. You can [silence these deprecation warnings](/importing-css-assets-and-javascript/#silence-deprecation-warnings-in-dart-sass) if you need to.

GOV.UK Frontend also works with:

- LibSass - version 3.3.0 or higher
Expand Down

0 comments on commit ffdb0b1

Please sign in to comment.