mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 02:21:18 +08:00
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:
@ -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$/
|
||||
|
Reference in New Issue
Block a user