Class: Malt::Engines::Less

Inherits:
Abstract show all
Defined in:
lib/malt/engines/less.rb

Overview

LESS

http://lesscss.org/

LESS is an extension of CSS. You can write LESS code just like you would write CSS, except you need to compile it to CSS. That’s what this class is for.

Instance Attribute Summary

Attributes inherited from Abstract

#settings

Instance Method Summary collapse

Methods inherited from Abstract

#cache?, #compile, default, #initialize, register

Constructor Details

This class inherits a constructor from Malt::Engines::Abstract

Instance Method Details

#intermediate(params) ⇒ Object



28
29
30
31
# File 'lib/malt/engines/less.rb', line 28

def intermediate(params)
  text = params[:text]
  ::Less::Engine.new(text)
end

#render(params) ⇒ Object



16
17
18
19
20
21
22
23
24
25
# File 'lib/malt/engines/less.rb', line 16

def render(params)
  text   = params[:text]
  format = params[:format]
  case format
  when :css, nil
    intermediate(params).to_css
  else
    super(params)
  end
end