Skip to content

Commit 0882b97

Browse files
marcotranchinokr8n3r
authored andcommitted
Introduce a custom module to silence dart sass warnings
With this change, we have defined a custom SassWarningSupressor module that overrides the warn method so that we can ignore messages containing 'sass' or 'dart-sass' only. This is needed so that we can avoid sass warnings in downstream projects.
1 parent eab85ee commit 0882b97

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/govuk_tech_docs.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@
2525
require "govuk_tech_docs/warning_text_extension"
2626
require "govuk_tech_docs/api_reference/api_reference_extension"
2727

28+
module SassWarningSupressor
29+
def warn(message)
30+
if message.to_s.match?(/Sass|dart-sass/i)
31+
# suppress dart sass warnings
32+
else
33+
super
34+
end
35+
end
36+
end
37+
38+
Warning.extend(SassWarningSupressor)
39+
2840
module GovukTechDocs
2941
# Configure the tech docs template
3042
#

0 commit comments

Comments
 (0)