1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-19 13:54:25 +01:00

Plugin::Instance can register a stylesheets, enable to import it in application.scss dynamically

This commit is contained in:
Nicolas Florentin 2016-05-11 09:40:04 +02:00
parent a14130473a
commit 0c00bf5895
4 changed files with 14 additions and 1 deletions

View File

@ -35,4 +35,8 @@
@import "app.responsive";
@import "navi_gami"; // change it to be dynamic !!!
<% FabManager.plugins.each do |plugin| %>
<% plugin.styles.each do |style| %>
<%= "@import '#{style}';" %>
<% end %>
<% end %>

View File

@ -62,6 +62,10 @@ module Plugin
assets << [full_path, opts]
end
def register_css(style)
styles << style
end
def after_initialize(&block)
initializers << block
end

View File

@ -0,0 +1,3 @@
#nav > section > section {
background: black;
}

View File

@ -1,6 +1,8 @@
register_asset "stylesheets/navi_gami.scss"
register_asset "javascripts/navi_gami.coffee.erb"
register_css('navi_gami')
PLUGIN_NAME ||= "navi_gami".freeze