Get rid of plugins.css, inject it using DiscourseSassImporter.

This commit is contained in:
Vikhyat Korrapati
2014-04-09 19:42:43 +05:30
parent 8c129e480a
commit 33307a50b3
7 changed files with 21 additions and 18 deletions
+14 -1
View File
@@ -35,7 +35,20 @@ class DiscourseSassImporter < Sass::Importers::Filesystem
end
def find(name, options)
if name =~ GLOB
if name == "plugins" || name == "plugins_mobile"
if name == "plugins"
stylesheets = DiscoursePluginRegistry.stylesheets
elsif name == "plugins_mobile"
stylesheets = DiscoursePluginRegistry.mobile_stylesheets
end
contents = ""
stylesheets.each {|css| contents << File.read(css) }
Sass::Engine.new(contents, options.merge(
filename: "#{name}.scss",
importer: self,
syntax: :scss
))
elsif name =~ GLOB
nil # globs must be relative
else
engine_from_path(name, root, options)