Skip to content

A platform for community discussion. Free, open, simple.

DEV: Resolve mixed-decls misconfiguration (#32858)

David Taylore2fe5671edbe
diff --git a/lib/stylesheet/compiler.rb b/lib/stylesheet/compiler.rb
index 01252c320b4..70667271e54 100644
--- a/lib/stylesheet/compiler.rb
+++ b/lib/stylesheet/compiler.rb
@@ -54,6 +54,15 @@ module Stylesheet
load_paths = [ASSET_ROOT]
load_paths += options[:load_paths] if options[:load_paths]
+ silence_deprecations = %w[color-functions import global-builtin]
+ fatal_deprecations = []
+
+ if options[:strict_deprecations]
+ fatal_deprecations << "mixed-decls"
+ else
+ silence_deprecations << "mixed-decls"
+ end
+
engine =
SassC::Engine.new(
stylesheet,
@@ -62,8 +71,8 @@ module Stylesheet
source_map_file: source_map_file,
source_map_contents: true,
load_paths: load_paths,
- silence_deprecations: %w[color-functions import global-builtin mixed-decls],
- fatal_deprecations: options[:strict_deprecations] ? %w[mixed-decls] : [],
+ silence_deprecations:,
+ fatal_deprecations:,
quiet: ENV["QUIET_SASS_DEPRECATIONS"] == "1",
)