Module: Middleman::Renderers::Less

Defined in:
lib/middleman-core/renderers/less.rb

Overview

Sass renderer

Defined Under Namespace

Classes: LocalLoadingLessTemplate

Class Method Summary collapse

Class Method Details

.registered(app) ⇒ Object Also known as: included

Once registered



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/middleman-core/renderers/less.rb', line 13

def registered(app)
  # Default less options
  app.config.define_setting :less, {}, 'LESS compiler options'

  app.before_configuration do
    template_extensions :less => :css
  end

  app.after_configuration do
    ::Less.paths << File.join(source_dir, config[:css_dir])
  end

  # Tell Tilt to use it as well (for inline sass blocks)
  ::Tilt.register 'less', LocalLoadingLessTemplate
  ::Tilt.prefer(LocalLoadingLessTemplate)
end