FEATURE: Multiple SCSS file support for themes (#7351)

Theme developers can include any number of scss files within the /scss/ directory of a theme. These can then be imported from the main common/desktop/mobile scss.
This commit is contained in:
David Taylor
2019-04-12 11:36:08 +01:00
committed by GitHub
parent 0e9a0a31f5
commit 268d4d4c82
19 changed files with 302 additions and 125 deletions

View File

@ -5,13 +5,12 @@ class ThemeSetting < ActiveRecord::Base
validates :data_type, numericality: { only_integer: true }
validates :name, length: { maximum: 255 }
after_save do
theme.clear_cached_settings!
theme.remove_from_cache!
theme.theme_fields.update_all(value_baked: nil)
theme.theme_settings.reload
SvgSprite.expire_cache if self.name.to_s.include?("_icon")
CSP::Extension.clear_theme_extensions_cache! if name.to_s == CSP::Extension::THEME_SETTING
after_save :clear_settings_cache
after_destroy :clear_settings_cache
def clear_settings_cache
# All necessary caches will be cleared on next ensure_baked!
theme.settings_field&.invalidate_baked!
end
def self.types