私はbootstrap-rails gemの最新のmasterブランチを使用しており、railsのアセットパイプラインと互換性のある方法でデフォルトのブートストラップ変数を変更しようとしています。RailsアセットパイプラインとTwitterのブートストラップGem
私の宝石のファイルは、これらの宝石は、私も私のapplication.css
ファイルに*= require bootstrap_and_overrides
を含ま
gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'
gem 'uglifier', '>= 1.0.3'
gem 'less-rails-bootstrap'
が含まれています。私は、スプロケットが個々のCSSファイルを個別にコンパイルすることを認識しています。したがって、複数のCSSファイルが相互に参照できることは期待できません。したがってbootstrap_and_overrides.css.lessファイルには、次のものが含まれます。
@import "twitter/bootstrap/bootstrap";
body { padding-top: 80px; }
//background-image: asset-url("background.png"); background-repeat:no-repeat; background-size: cover; }
@import "twitter/bootstrap/responsive";
// Set the correct sprite paths
@iconSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings.png');
@iconWhiteSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings-white.png');
// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
@fontAwesomeEotPath: asset-path('fontawesome-webfont.eot');
@fontAwesomeWoffPath: asset-path('fontawesome-webfont.woff');
@fontAwesomeTtfPath: asset-path('fontawesome-webfont.ttf');
@fontAwesomeSvgzPath: asset-path('fontawesome-webfont.svgz');
@fontAwesomeSvgPath: asset-path('fontawesome-webfont.svg');
// Font Awesome
@import "fontawesome";
// Your custom LESS stylesheets goes here
//
// Since bootstrap was imported above you have access to its mixins which
// you may use and inherit here
//
// If you'd like to override bootstrap's own variables, you can do so here as well
// See http://twitter.github.com/bootstrap/less.html for their names and documentation
//
// Example:
// @linkColor: #ff0000;
@navbarHeight: 60px;
@navbarText: @white;
@textColor: @orange;
@navbarLinkColor: @white;
@navbarBackground: darken(@linkColor, 15%);
@navbarBackgroundHighlight: @linkColor;
しかし私のオーバーライドのいずれもが、資産パイプラインの下で働くありません。彼らはそれなしで正常に動作します。誰でも知っている理由は?私の場合は
アップデートマイ資産宝石グループ
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'less-rails'
# gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', :platform => :ruby
gem 'uglifier', '>= 1.0.3'
end
をapplication.css.scssするレール4.1と少なく、ブートストラップを使用し、2.0ルビーしかし、私は追加することによって、これを固定しています、あなたの資産グループの少ないレールの宝石を持っていますか? – Swift
私は、私の宝石資産グループ –