Sha256: 97a8f876cc3778ce5ef1e8cc91d0c9150269563b228e5aede001bf48331664c9

Contents?: true

Size: 689 Bytes

Versions: 1

Compression:

Stored size: 689 Bytes

Contents

require 'malt/formats/abstract'
require 'malt/engines/less'

module Malt::Formats

  # = LESS
  #
  # See http://lesscss.org/
  #
  class LESS < Abstract

    register('less')

    #
    def less
      text
    end

    #
    def to_less
      self
    end

    #
    def css
      render_engine.render(:text=>text, :file=>:file, :format=>:css)
    end

    #
    def to_css
      text = css
      opts = options.merge(:text=>text, file=>refile(:css), :type=>:css)
      CSS.new(opts)
    end

    private

    #
    def render_engine
      @render_engine ||= Malt::Engines::Less.new(options)
    end

    # LESS default output type is CSS.
    def default
      :css
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
malt-0.1.0 lib/malt/formats/less.rb