Rewrites all 12 frontend ADRs from a custom structure to the MADR 2.1.2 template required by the VS Code ADR Manager extension: bullet metadata (Status/Date), standardised section headings, "Chosen option: X, because Y" wording, and explicit Pros/Cons blocks per option.
2.6 KiB
Silence the Sass @import deprecation for the Bootstrap import chain
- Status: accepted
- Date: 2026-04-26
Context and Problem Statement
Bootstrap 5 relies on Sass's @import rule and !default variable overrides: our custom _variable.scss must be loaded before Bootstrap's variables.scss so that Bootstrap picks up our values via the !default mechanism. Dart Sass 1.80+ deprecates @import in favour of the @use module system. How should the deprecation be addressed?
Decision Drivers
- Bootstrap 5's
!defaultoverride mechanism is incompatible with@usemodule scopes — variables loaded via@usedo not flow into Bootstrap's module scope. - Other Dart Sass deprecations (
color.red/green/blue(), globalif()) were fixed properly.
Considered Options
- Silence the
@importdeprecation viaangular.json - Migrate to
@usewith@use "bootstrap" with (...) - Wait for Bootstrap 6
Decision Outcome
Chosen option: "Silence the @import deprecation via angular.json", because the @use migration is blocked by Bootstrap 5's architecture and Bootstrap 6 (which adopts @use natively) is not yet released.
The deprecation is suppressed in angular.json via stylePreprocessorOptions.sass.silenceDeprecations: ["import"]. The existing @import-based Bootstrap loading chain is kept intact. All other Dart Sass deprecations are fixed properly.
Positive Consequences
- Bootstrap customisation works correctly with no behaviour change.
- No risk of introducing regressions by attempting an incompatible migration now.
Negative Consequences
- Deprecation is silenced rather than fixed.
@importwill be removed in Dart Sass 3.0.
Pros and Cons of the Options
Silence the @import deprecation
- Good, because no behaviour change — existing variable overrides continue to work.
- Bad, because the underlying issue is deferred, not resolved.
Migrate to @use with @use "bootstrap" with (...)
- Good, because fully resolves the deprecation.
- Bad, because requires rewriting all Bootstrap variable overrides using
with ()syntax — significant effort. - Bad, because the
with ()syntax has limitations compared to!defaultchaining.
Wait for Bootstrap 6
- Good, because Bootstrap 6 adopts
@usenatively — migration path will be documented by the Bootstrap team. - Bad, because Bootstrap 6 release date is unknown; deferring means living with the silenced warning.
Links
- Related to ADR 0003
- Future action: when Bootstrap 6 is released with
@usesupport, migrate the import chain, remove thesilenceDeprecationsentry, and supersede this ADR.