mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user