-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Sass @import Deprecation Warnings
Definition of done:
- Add
config.sass.silence_deprecations = ['import']toconfig/application.rb
What's happening?
Dart Sass has deprecated @import in favour of @use and @forward. These warnings appear during asset compilation but do not affect the build output — CSS is still generated correctly.
Source of the warnings
The warnings come from two places:
-
Our own SCSS files (can be migrated)
app/javascript/stylesheets/application.scss— uses@importfor local partialsapp/javascript/stylesheets/_gov_uk.scss— uses@importfor local and vendor styles
-
Third-party dependencies (cannot be migrated by us)
govuk_frontend_toolkit— GOV.UK legacy toolkit (no longer maintained)govuk-elements-sass— GOV.UK legacy elements (deprecated)
Why we're silencing these warnings
We've added the following configuration to the other LR apps to suppress these warnings:
config.sass.quiet_deps = true
config.sass.silence_deprecations = ['import']This is the recommended approach per Sass documentation when:
- You depend on third-party libraries that haven't migrated yet
- The migration to
@use/@forwardis planned but not immediate
Is this safe?
Yes, for now. The warnings are informational — @import still works in Dart Sass 1.x and 2.x. It will only be removed in Dart Sass 3.0.0, which has no release date yet.
Future action required
When we're ready to fully migrate (likely when we move away from the legacy toolkit), we'll need to:
- Replace
@importwith@useand@forwardin our own SCSS files - Replace the
govuk_frontend_toolkitandgovuk-elements-sassdependencies
References
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels