mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +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:
parent
535965263a
commit
64918c35f5
8 changed files with 85 additions and 19 deletions
|
@ -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$/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue