I'm building an application with Padrino, and I've decided to use less for the stylesheet, mostly to use twitter bootstrap.
I am having some trouble getting less to automatically compile my less files when serving the app via pow.
When I run padrino start
and use the embedded server, I get nice styling, but I don't really understand how. The application.css file that is generated is exactly how it should be, except there are no changes to the application.css file in my app's public dir.
When I run the app through pow, though, no changes made to the application.less file are reflected on the application.css file, which is the only one served.
I'm mostly trying to understand how and why less is only compiled when running webrick.
My less initializer is:
module LessInitializer
def self.registered(app)
# Enables support for Less template reloading for rack.
# Store Less files by default within 'app/stylesheets/'
# See http://github.com/kelredd/rack-less for more details.
require 'rack/less'
# optional - use as necessary
Rack::Less.configure do |config|
config.compress = true
config.cache = true
# other configs ...
end
app.use Rack::Less,
:root => Padrino.root,
:source => 'app/stylesheets',
:public => 'public',
:hosted_at => 'stylesheets'
end
end
And my application.less
file is:
@import "bootstrap/bootstrap.less";
body {
padding-top: 60px;
padding-bottom: 40px;
}
.sidebar-nav {
padding: 9px 0;
}