compass hooks
This commit is contained in:
parent
0ed1a73450
commit
ec0aa868f4
|
@ -3,6 +3,7 @@ module Middleman::CoreExtensions::Compass
|
||||||
def registered(app)
|
def registered(app)
|
||||||
# Where to look for fonts
|
# Where to look for fonts
|
||||||
app.set :fonts_dir, "fonts"
|
app.set :fonts_dir, "fonts"
|
||||||
|
app.define_hook :after_compass_config
|
||||||
|
|
||||||
app.extend ClassMethods
|
app.extend ClassMethods
|
||||||
|
|
||||||
|
@ -83,10 +84,7 @@ module Middleman::CoreExtensions::Compass
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
app.execute_after_compass_init!
|
run_hook :after_compass_config, ::Compass.configuration
|
||||||
app.execute_after_compass_config!
|
|
||||||
|
|
||||||
# app.set :sass, ::Compass.configuration.to_sass_engine_options
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
alias :included :registered
|
alias :included :registered
|
||||||
|
@ -95,23 +93,11 @@ module Middleman::CoreExtensions::Compass
|
||||||
module ClassMethods
|
module ClassMethods
|
||||||
# Add a block/proc to be run after features have been setup
|
# Add a block/proc to be run after features have been setup
|
||||||
def compass_config(&block)
|
def compass_config(&block)
|
||||||
@run_after_compass ||= []
|
after_compass_config(&block)
|
||||||
@run_after_compass << block
|
|
||||||
end
|
|
||||||
|
|
||||||
def execute_after_compass_init!
|
|
||||||
@run_after_compass ||= []
|
|
||||||
@run_after_compass.each { |block| block.call(::Compass.configuration) }
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def after_compass_config(&block)
|
def after_compass_config(&block)
|
||||||
@run_after_compass_config ||= []
|
after_compass_config(&block)
|
||||||
@run_after_compass_config << block
|
|
||||||
end
|
|
||||||
|
|
||||||
def execute_after_compass_config!
|
|
||||||
@run_after_compass_config ||= []
|
|
||||||
@run_after_compass_config.each { |block| block.call() }
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
Loading…
Reference in a new issue