From 3d689bbbc26b58947c86b070bef717b4849e23e5 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Wed, 16 Apr 2025 16:36:41 +0100 Subject: [PATCH] DEV: Raise exception for deprecations in core stylesheets (#31894) --- lib/stylesheet/compiler.rb | 1 + lib/stylesheet/manager/builder.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/stylesheet/compiler.rb b/lib/stylesheet/compiler.rb index 003410e8032..146fa34c82d 100644 --- a/lib/stylesheet/compiler.rb +++ b/lib/stylesheet/compiler.rb @@ -63,6 +63,7 @@ module Stylesheet source_map_contents: true, load_paths: load_paths, silence_deprecations: %w[color-functions import global-builtin], + fatal_deprecations: options[:strict_deprecations] ? %w[mixed-decls] : [], quiet: ENV["QUIET_SASS_DEPRECATIONS"] == "1", ) diff --git a/lib/stylesheet/manager/builder.rb b/lib/stylesheet/manager/builder.rb index ce778b68187..aaf0a256168 100644 --- a/lib/stylesheet/manager/builder.rb +++ b/lib/stylesheet/manager/builder.rb @@ -48,6 +48,7 @@ class Stylesheet::Manager::Builder color_scheme_id: @color_scheme&.id, load_paths: load_paths, dark: @dark, + strict_deprecations: %i[desktop mobile admin wizard].include?(@target), ) rescue SassC::SyntaxError, SassC::NotRenderedError, DiscourseJsProcessor::TranspileError => e if Stylesheet::Importer::THEME_TARGETS.include?(@target.to_s)