I'm attempting to create a standalone application (independent of the Rails asset pipeline) using less.rb to output CSS files based upon Twitter Bootstrap.
The following results in an empty document
parser = Less::Parser.new :paths => [Rails.root + '/public/bootstraps/twitter-bootstrap-857b8fb/less']
tree = parser.parse("@import 'bootstrap.less'")
tree.to_css
Which results in an empty string being returned. I've tried variations of altering the @import to be the full path etc, with no success. I think I must be missing something simple.
I believe you have an issue with how you are specifying your path. As far as I can tell, Less is looking for an array of String
objects, not Path
obejcts.
Use the following:
parser = Less::Parser.new paths: [Rails.root.join('public', 'bootstraps', 'twitter-bootstrap-857b8fb', 'less').to_s]
tree = parser.parse("@import 'bootstrap.less'")
tree.to_css
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With