我正在用Padrino構建一個應用程序,並且我決定少用這個樣式表,主要是使用twitter bootstrap。少用pow自動編譯
我在通過pow提供應用程序時自動編譯少量文件時遇到了一些麻煩。
當我運行padrino start
並使用嵌入式服務器時,我得到了很好的樣式,但我不太瞭解如何。生成的application.css文件的確如此,除非應用程序的公共目錄中的application.css文件沒有更改。
當我通過pow運行應用程序時,雖然沒有對application.less文件所做的更改反映在application.css文件中,該文件是唯一服務的文件。
我主要試圖瞭解如何以及爲什麼less只在編譯運行webrick時編譯。
我不太初始化爲:
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
而且我application.less
文件是:
@import "bootstrap/bootstrap.less";
body {
padding-top: 60px;
padding-bottom: 40px;
}
.sidebar-nav {
padding: 9px 0;
}