我有一個rails應用程序,並管理我的資產,我正在使用涼亭。如果可能的話,我更喜歡不使用像JS和CSS這樣的資源。字體很棒字體沒有加載?
在我的vender/assets/stylesheets
目錄中,我有以下內容:font-awesome
有scss
和fonts
。
在我的軌道app/assets/stylesheets/application.scss
我有以下幾點:
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= require_self
*= require_tree .
*= require style.scss
*= require chosen/chosen.min
*= require jquery.ui.all
*= require selectize.js/css/selectize.css
*= require selectize.js/css/selectize.bootstrap3.css
*= require font-awesome/scss/font-awesome
*/
的頁面加載罰款。但是,當我這樣做時:<i class="fa-question></i>
而不是得到一個問號我得到一個[]
。所以,我檢查了源標籤在Chrome中看到最新加載和font-awesome
目錄下它只是font-awesome.scss
,在觀看在那裏我看到:
/*!
* Font Awesome 4.1.0 by @davegandy - http://fontawesome.io - @fontawesome
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
*/
@import "variables";
@import "mixins";
@import "path";
@import "core";
@import "larger";
@import "fixed-width";
@import "list";
@import "bordered-pulled";
@import "spinning";
@import "rotated-flipped";
@import "stacked";
@import "icons";
所以我自信地說,這是加載CSS ,但字體未被加載。所以,我看着變量,其中的字體路徑將定義見:
$fa-font-path: "../fonts" !default;
而基於上面列出的目錄結構,字體目錄確實是一個目錄了。
那麼,是怎麼回事?
請缺失報價添加到類的末尾。 – Timbadu
@Timbadu完成,謝謝! –