Skip to content

Instantly share code, notes, and snippets.

@mjtko
Created September 21, 2011 11:26
Show Gist options
  • Save mjtko/1231833 to your computer and use it in GitHub Desktop.
Save mjtko/1231833 to your computer and use it in GitHub Desktop.
Less with assets pipeline
/*
*= require bootstrap
*/
/*
* app/assets/bootstrap.css.less
*/
@import "bootstrap/bootstrap.less";
# config/initializers/less.rb
require 'tilt/css'
module Tilt
class LessTemplate < Template
def prepare
if ::Less.const_defined? :Engine
@engine = ::Less::Engine.new(data)
else
# this line was the key :-)
parser = ::Less::Parser.new(:filename => eval_file, :line => line, :paths => [Rails.root.join('app','less')])
@engine = parser.parse(data)
end
end
end
end
Place the bootstrap/lib/*.less files in app/less/bootstrap/*.less
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment