我有一个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完成,谢谢! –