Improved Plugins SCSS management

- Moves the import of plugins for both mobile and desktop from common after discourse loading, allowing plugins to overwrite
 - Make desktop-option behave like the mobile-option: SCSS/CSS marked with that option will only be loaded for desktop from now on and ignored in mobile
 - Add variables-keyword, allowing plugins to ship and overwrite variables before they get imported by discourse (great for theming)
This commit is contained in:
Benjamin Kampmann
2014-04-25 10:26:37 +02:00
parent 535965263a
commit 64918c35f5
8 changed files with 85 additions and 19 deletions

View File

@ -222,12 +222,14 @@ class Plugin::Instance
DiscoursePluginRegistry.javascripts << asset
end
elsif asset =~ /\.css$|\.scss$/
unless opts == :mobile
DiscoursePluginRegistry.stylesheets << asset
end
unless opts == :desktop
if opts == :mobile
DiscoursePluginRegistry.mobile_stylesheets << asset
elsif opts == :desktop
DiscoursePluginRegistry.desktop_stylesheets << asset
elsif opts == :variables
DiscoursePluginRegistry.sass_variables << asset
else
DiscoursePluginRegistry.stylesheets << asset
end
elsif asset =~ /\.js\.handlebars$/