我在使用字體真棒在軌3.2.13應用程序。我已成功將以下圖標添加到應用程序中:圖標搜索圖標購物車等。但由於某種原因,當我嘗試使用圖標大拇指和圖標大拇指向下時,它們看起來像是圖標大拇指或圖標大拇指向上。如果我嘗試使用icon-thumb-up-alt,則頁面上不會顯示任何圖標。字體真棒 - 越來越錯了圖標
我通過寶石訪問兩個引導和字體真棒:
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'therubyracer'
gem 'font-awesome-rails'
gem 'jquery-ui-rails'
gem 'less-rails'
gem 'twitter-bootstrap-rails'
gem 'uglifier', '>= 1.0.3'
end
這裏是application.css.scss文件:
*= require bootstrap_and_overrides
*= require_self
*= require_tree .
@import "font-awesome";
.icon-thumbs-up {
color: green;
}
.icon-thumbs-down {
color: red;
}
這裏是bootstrap_and_overrides.css.less
@import "twitter/bootstrap/bootstrap";
body { padding-top: 50px; }
@import "twitter/bootstrap/responsive";
// Set the correct sprite paths
@iconSpritePath: asset-path("twitter/bootstrap/glyphicons-halflings");
@iconWhiteSpritePath: asset-path("twitter/bootstrap/glyphicons-halflings-white");
// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
// Note: If you use asset_path() here, your compiled boostrap_and_overrides.css will not
// have the proper paths. So for now we use the absolute path.
@fontAwesomeEotPath: asset-path("fontawesome-webfont.eot");
@fontAwesomeWoffPath: asset-path("fontawesome-webfont.woff");
@fontAwesomeTtfPath: asset-path("fontawesome-webfont.ttf");
@fontAwesomeSvgPath: asset-path("fontawesome-webfont.svg");
// Font Awesome
@import "fontawesome";
下面是使用圖標的按鈕:
<%= link_to (content_tag(:i, "", :class=>"icon-thumbs-up")) + (content_tag(:i, "", :class=>"icon-thumbs-down")) + " Review", root_path , :class => "btn" %>
問題可能是衝突,因爲我添加了twitter-bootstrap-rails和font-awesome-rails gems?
感謝 史蒂夫
至今沒沒有工作,我試圖創建一個全新的應用程序,只使用twitter-bootstrap-rails,上面的例子中,我試圖找到文檔,如果寶石包括最新的圖標設置在字體真棒3.2.1 – Steve
我建議你檢查網絡,如果你看到主人的最後一次提交,這是一個合併添加Font Awesome 3.2.1。 https://github.com/seyhunak/twitter-bootstrap-rails/network –