Created
September 21, 2011 11:26
-
-
Save mjtko/1231833 to your computer and use it in GitHub Desktop.
Less with assets pipeline
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
*= require bootstrap | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* app/assets/bootstrap.css.less | |
*/ | |
@import "bootstrap/bootstrap.less"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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