FIX: Improve SCSS handling in components (#11963)

- ignores errors when including component SCSS in parent theme
- adds support for SCSS `@import`s in components' `color_definitions.scss` files
This commit is contained in:
Penar Musaraj
2021-02-04 08:51:18 -05:00
committed by GitHub
parent b580e3e657
commit 12ffba771c
4 changed files with 33 additions and 13 deletions

View File

@@ -354,6 +354,18 @@ class ThemeField < ActiveRecord::Base
)
end
def compiled_css
css, _source_map = begin
compile_scss
rescue SassC::SyntaxError => e
# We don't want to raise a blocking error here
# admin theme editor or discourse_theme CLI will show it nonetheless
Rails.logger.error "SCSS compilation error: #{e.message}"
["", nil]
end
css
end
def ensure_scss_compiles!
result = ["failed"]
begin