docs(adr): convert all ADRs to MADR 2.1.2 format
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.
This commit is contained in:
@@ -1,29 +1,57 @@
|
||||
# ADR 0012: SCSS Strategy — Bootstrap Variable Overrides and Sass @import Deprecation
|
||||
# Silence the Sass @import deprecation for the Bootstrap import chain
|
||||
|
||||
**Date:** 2026-04-26
|
||||
**Status:** Accepted (workaround pending Bootstrap 6)
|
||||
- Status: accepted
|
||||
- Date: 2026-04-26
|
||||
|
||||
## Context
|
||||
## 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 `!default`.
|
||||
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?
|
||||
|
||||
Dart Sass 1.80+ deprecates `@import` in favour of the `@use` module system. The `@use` system uses isolated module scopes, which breaks the `!default` override mechanism: variables loaded via `@use` in our file do not flow into Bootstrap's module scope.
|
||||
## Decision Drivers
|
||||
|
||||
Migrating to `@use` for the Bootstrap import chain would require either:
|
||||
- Bootstrap 5's `!default` override mechanism is incompatible with `@use` module scopes — variables loaded via `@use` do not flow into Bootstrap's module scope.
|
||||
- Other Dart Sass deprecations (`color.red/green/blue()`, global `if()`) were fixed properly.
|
||||
|
||||
- Waiting for Bootstrap 6, which is expected to adopt `@use` natively.
|
||||
- Rewriting the entire Bootstrap variable override mechanism using `@use "bootstrap" with (...)`.
|
||||
## Considered Options
|
||||
|
||||
Neither option is viable in the short term.
|
||||
- Silence the `@import` deprecation via `angular.json`
|
||||
- Migrate to `@use` with `@use "bootstrap" with (...)`
|
||||
- Wait for Bootstrap 6
|
||||
|
||||
## Decision
|
||||
## Decision Outcome
|
||||
|
||||
- Suppress the Sass `@import` deprecation warning in `angular.json` via `stylePreprocessorOptions.sass.silenceDeprecations: ["import"]`.
|
||||
- Keep the existing `@import`-based Bootstrap loading chain intact.
|
||||
- Fix other Dart Sass deprecations properly: `color.red/green/blue()` replaced with `color.channel()`, global `if()` replaced with `@if`/`@else`.
|
||||
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.
|
||||
|
||||
## Consequences
|
||||
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:** Bootstrap customisation works correctly with no behaviour change.
|
||||
- **Negative:** Deprecation silenced rather than fixed. `@import` will be removed in Dart Sass 3.0.
|
||||
- **Future action:** When Bootstrap 6 is released with `@use` support, migrate the import chain and remove the `silenceDeprecations` entry. Supersede this ADR at that point.
|
||||
### 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. `@import` will 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 `!default` chaining.
|
||||
|
||||
### Wait for Bootstrap 6
|
||||
|
||||
- Good, because Bootstrap 6 adopts `@use` natively — 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](0003-dual-ui-library-progressive-migration.md)
|
||||
- Future action: when Bootstrap 6 is released with `@use` support, migrate the import chain, remove the `silenceDeprecations` entry, and supersede this ADR.
|
||||
|
||||
Reference in New Issue
Block a user