Class: Middleman::Renderers::Less
- Defined in:
- middleman-core/lib/middleman-core/renderers/less.rb
Overview
Sass renderer
Defined Under Namespace
Classes: LocalLoadingLessTemplate
Constant Summary
Constants included from Contracts
Instance Attribute Summary
Attributes inherited from Extension
Instance Method Summary collapse
- #after_configuration ⇒ Object
-
#initialize(app, options_hash = ::Middleman::EMPTY_HASH, &block) ⇒ Less
constructor
A new instance of Less.
Methods inherited from Extension
activated_extension, #add_exposed_to_context, #after_build, after_extension_activated, #after_extension_activated, #before_build, #before_configuration, clear_after_extension_callbacks, config, define_setting, expose_to_application, expose_to_config, expose_to_template, global_config, helpers, #manipulate_resource_list, option, #ready, resources
Methods included from Contracts
Constructor Details
#initialize(app, options_hash = ::Middleman::EMPTY_HASH, &block) ⇒ Less
Returns a new instance of Less.
11 12 13 14 15 16 17 |
# File 'middleman-core/lib/middleman-core/renderers/less.rb', line 11 def initialize(app, = ::Middleman::EMPTY_HASH, &block) super # Tell Tilt to use it as well (for inline sass blocks) ::Tilt.register 'less', LocalLoadingLessTemplate ::Tilt.prefer(LocalLoadingLessTemplate) end |
Instance Method Details
#after_configuration ⇒ Object
19 20 21 22 23 |
# File 'middleman-core/lib/middleman-core/renderers/less.rb', line 19 def after_configuration app.files.by_type(:source).watchers.each do |source| ::Less.paths << (source.directory + app.config[:css_dir]).to_s end end |