I have a Modular Sinatra app and I'm trying to add the Bootstrap less to the application.
get '/bootstrap/application.css' do
less :"bootstrap/bootstrap"
end
I have all less files in views/bootstrap, including bootstrap.less.
I get this error:
Less::ParseError at /bootstrap/application.css 'reset.less' wasn't found.
The first real line of Bootstrap.less is:
// CSS Reset
@import "reset.less";
I've tried all different path formats, but it never finds the files it's looking to import. Any idea how to make this work?
Have you tried passing the :paths
config option?
get '/bootstrap/application.css' do
less :"bootstrap/bootstrap", :paths => ["views/bootstrap"]
end
I've had problems with this option in the past but it may work for you.
I found a solution that worked for me here: Parsing LESS options in a Sinatra app
Since this question was the one I found first on Google, I thought I'd leave the link here so that others can find it.
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