Migrate to Sass module system (@use)
See original GitHub issueWhat
Update GOV.UK Frontend to use the new @use
syntax internally to import dependencies, and to be consumed using @use
.
Why
The Sass module system has been introduced, aiming to address some of the issues with the @import
rule.
The @import
rule, and most global functions will eventually be deprecated, and then removed from Sass.
Moving to @use
will allow us to revisit and simplify the way that GOV.UK Frontend is implemented, without the limitations of @import
– for example namespacing, and the govuk-exports mixin.
Depends on
Stable support for @uses
in LibSass – which probably means a stable version with support having been out for 3-6 months.
(The ‘future plans’ section of the module system blog post sets a hard limit of October 2021 for deprecating @import
, which we could also do, but we’d need to have a better understanding of the impact it’ll have on our users.)
Further detail
We would only support compilation using Dart Sass.
We would drop support for the other compilers, which are deprecated and will not be updated to use the new module system:
- Ruby Sass, deprecated as of 26 March 2019
- LibSass, deprecated as of 5 Aug 2020
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (5 by maintainers)
Top GitHub Comments
Apparently Dart Sass adoption is currently around 66%.
I’ve been digging around the Sass repos for new information on when
@import
is going to be deprecated or removed, given there hasn’t been any official update that the date was changed from October 2021.The comment here (December 2021) seems to imply that the deprecation did not take place due to the ecosystem not migrating to Dart Sass as quickly as anticipated, with no new date being set for it to take place. https://github.com/sass/sass/issues/3223#issuecomment-1002813284
This follow up I’ve asked indicates that they consider 70–80% adoption of Dart Sass to be the threshold for them to start the deprecation process. https://github.com/sass/sass/issues/3276#issuecomment-1076789429 — The current metrics don’t appear to be publicly available at this time, however.