Class: Middleman::Renderers::Less

Inherits:
Extension
  • Object
show all
Defined in:
lib/middleman-core/renderers/less.rb

Overview

Sass renderer

Defined Under Namespace

Classes: LocalLoadingLessTemplate

Constant Summary

Constants included from Contracts

Contracts::PATH_MATCHER

Instance Attribute Summary

Attributes inherited from Extension

#app, #options

Instance Method Summary collapse

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

#Contract

Constructor Details

#initialize(app, options = {}, &block) ⇒ Less

Returns a new instance of Less.



9
10
11
12
13
14
15
# File 'lib/middleman-core/renderers/less.rb', line 9

def initialize(app, options={}, &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_configurationObject



17
18
19
20
21
# File 'lib/middleman-core/renderers/less.rb', line 17

def after_configuration
  app.files.by_type(:source).watchers.each do |source|
    ::Less.paths << (source.directory + app.config[:css_dir]).to_s
  end
end