DEV: Plugins can extend color definitions (#10383)

This commit is contained in:
Penar Musaraj
2020-08-06 09:46:17 -04:00
committed by GitHub
parent 6fdc711b4a
commit 87e2c9de24
8 changed files with 58 additions and 2 deletions

View File

@@ -115,6 +115,17 @@ module Stylesheet
register_imports!
def self.import_color_definitions
return "" unless DiscoursePluginRegistry.color_definition_stylesheets.length
contents = +""
DiscoursePluginRegistry.color_definition_stylesheets.each do |name, path|
contents << "// Color definitions from #{name}\n\n"
contents << File.read(path.to_s)
contents << "\n\n"
end
contents
end
def initialize(options)
@theme = options[:theme]
@theme_id = options[:theme_id]