diff --git a/source/_includes/deprecations.liquid b/source/_includes/deprecations.liquid
new file mode 100644
index 000000000..655aec892
--- /dev/null
+++ b/source/_includes/deprecations.liquid
@@ -0,0 +1,33 @@
+{%- if deprecations.size == 0 -%}
+
There are no {{status}} deprecations in the latest version of Dart Sass.
+{%- else -%}
+The following deprecation IDs can be passed to this option:
+
+
+
+
+ ID |
+ {%- if status == "active" -%}Version | {%- endif -%}
+ Description |
+
+
+
+{%- for deprecation in deprecations -%}
+
+
+ {%- if deprecation.hasWebpage -%}
+
+ {%- endif -%}
+ {{deprecation.id}}
+ {%-if deprecation.hasWebpage -%}{%- endif -%}
+ |
+ {%- if status == "active" -%}
+ {{deprecation.deprecatedIn}} |
+ {%- endif -%}
+ {{deprecation.description}} |
+
+{%- endfor -%}
+
+
+{%- endif -%}
+
diff --git a/source/documentation/cli/dart-sass.md b/source/documentation/cli/dart-sass.md
index b7dfe35eb..c116c9fcb 100644
--- a/source/documentation/cli/dart-sass.md
+++ b/source/documentation/cli/dart-sass.md
@@ -478,79 +478,7 @@ Remove this setting if you need to keep using this feature.
style.scss 1:9 root stylesheet
```
-The following deprecation IDs can be passed to this option:
-
-
-
-
- ID |
- Version |
- Description |
-
-
-
-
- call-string |
- 0.0.0 |
- Passing a string directly to meta.call() . |
-
-
- elseif |
- 1.3.2 |
- Using @elseif instead of @else if . |
-
-
- moz-document |
- 1.7.2 |
- Using @-moz-document (except for the empty url prefix hack). |
-
-
- new-global |
- 1.17.2 |
- Declaring new variables with !global . |
-
-
- color-module-compat |
- 1.23.0 |
- Using color module functions in place of plain CSS functions. |
-
-
- slash-div |
- 1.33.0 |
- Using the / operator for division. |
-
-
- bogus-combinators |
- 1.54.0 |
- Leading, trailing, and repeated combinators. |
-
-
- strict-unary |
- 1.55.0 |
- Ambiguous + and - operators. |
-
-
- function-units |
- 1.56.0 |
- Passing invalid units to built-in functions. |
-
-
- duplicate-var-flags |
- 1.62.0 |
- Using multiple copies of !global or !default in a single variable declaration. |
-
-
- abs-percent |
- 1.65.0 |
- Passing percentages to the Sass abs() function. |
-
-
- fs-importer-cwd |
- 1.73.0 |
- Using the current working directory as an implicit load path. |
-
-
-
+{% deprecations 'active' %}{% enddeprecations %}
Alternatively, you can pass a Dart Sass version to treat all deprecations that
were present in that version as errors. For example,
@@ -567,9 +495,6 @@ early, emitting warnings even though the deprecation is not yet active. This
option can be combined with `--fatal-deprecation` to emit errors instead of
warnings for a future deprecation.
-The only currently available future deprecation type is `import`, as seen
-here:
-
```shellsession
$ sass --future-deprecation=import style.scss style.css
Deprecation Warning on line 1, column 9 of style.scss:
@@ -581,6 +506,8 @@ Remove the --future-deprecation=import flag to silence this warning for now.
╵
```
+{% deprecations 'future' %}{% enddeprecations %}
+
#### `--silence-deprecation`
{% compatibility 'dart: "1.74.0"' %}{% endcompatibility %}
diff --git a/source/helpers/components/deprecations.ts b/source/helpers/components/deprecations.ts
new file mode 100644
index 000000000..eec80ce04
--- /dev/null
+++ b/source/helpers/components/deprecations.ts
@@ -0,0 +1,30 @@
+import fs from 'node:fs';
+import sass from 'sass';
+
+import {liquidEngine} from '../engines';
+
+/**
+ * Renders a table of deprecations with the given status.
+ */
+export default async function deprecations(
+ _: string,
+ status: 'active' | 'future'
+) {
+ const deprecations = [];
+ for (const [id, deprecation] of Object.entries(sass.deprecations)) {
+ if (deprecation.status === status) {
+ deprecations.push({
+ id: id,
+ deprecatedIn: deprecation.deprecatedIn,
+ description: deprecation.description,
+ hasWebpage: fs.existsSync(
+ `source/documentation/breaking-changes/${id}.md`
+ ),
+ });
+ }
+ }
+ return liquidEngine.renderFile('deprecations', {
+ deprecations,
+ status,
+ });
+}
diff --git a/source/helpers/components/index.ts b/source/helpers/components/index.ts
index 7e945e2fe..ae85ddcef 100644
--- a/source/helpers/components/index.ts
+++ b/source/helpers/components/index.ts
@@ -5,10 +5,12 @@ import {liquidEngine} from '../engines';
import {stripIndent} from '../type';
import {default as codeExample} from './codeExample';
import {compatibility, implStatus} from './compatibility';
+import {default as deprecations} from './deprecations';
import {getDocTocData, getToc} from './toc';
export {codeExample};
export {compatibility, implStatus};
+export {deprecations};
export {getDocTocData, getToc};
/**
@@ -69,6 +71,7 @@ export default function componentsPlugin(eleventyConfig: any) {
// In the meantime, check the order in the function definition of
// `compatibility` in `source/helpers/components/compatibility.ts`.
eleventyConfig.addPairedLiquidShortcode('compatibility', compatibility);
+ eleventyConfig.addPairedLiquidShortcode('deprecations', deprecations);
eleventyConfig.addPairedLiquidShortcode('funFact', funFact);
eleventyConfig.addPairedLiquidShortcode('headsUp', headsUp);
}