css - Asset Pipeline undefined variable SASS

标签 css ruby-on-rails twitter-bootstrap sass

我一直在尝试使用 http://startbootstrap.com/stylish-portfolio下载所有文件并复制到目录后,我在部分 _bordered-pull 上收到以下错误:

ActionView::Template::Error (Undefined variable: "$fa-css-prefix".

但是变量已定义,我正在导入(或至少尝试)部分变量。

我的 Assets /样式表目录如下:

--application.css.scss
--bootstrap.css.scss
--font-awesome.css.scss.erb
--stylish-portfolio.css.scss
--|font-awesome
  --_bordered-pulled.css.scss
  --...(other partials)
  --font-awesome.css.scss

应用程序.css.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 .
 */

@import 'font-awesome/font-awesome';
@import 'bootstrap';
@import 'font-awesome';
@import 'stylish-portfolio';

字体awesome.css.scss

/*!
 *  Font Awesome 4.0.3 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";

_bordered-pulled.css.scss

// Bordered & Pulled
// -------------------------

.#{$fa-css-prefix}-border {
  padding: .2em .25em .15em;
  border: solid .08em $fa-border-color;
  border-radius: .1em;
}

.pull-right { float: right; }
.pull-left { float: left; }

.#{$fa-css-prefix} {
  &.pull-left { margin-right: .3em; }
  &.pull-right { margin-left: .3em; }
}

是语法错误还是我的资源管道设置有误?

_变量.css.scss https://github.com/IronSummitMedia/startbootstrap/blob/master/templates/stylish-portfolio/font-awesome/scss/_variables.scss

最佳答案

您必须执行以下操作:

Open your project's font-awesome/less/variables.less or font-awesome/scss/_variables.scss and edit the @fa-font-path or $fa-font-path variable to point to your font directory.

来源:fontawsome 的文档

http://fontawesome.io/get-started#custom-less

关于css - Asset Pipeline undefined variable SASS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21142113/

相关文章:

html - 标准化 <LI> 内部文本和元素符号之间的距离

ruby-on-rails - Ruby On Rails 4 - 路由问题

php - 搜索和分页

html - Bootstrap 表单不在 div 的中心

css - 当父级溢出时使子级下拉可见 :scroll

html - 用文本覆盖 <div>

ruby-on-rails - OSX 和 Rails 2.3.x 上的 unixodbc 和 freetds 设置

ruby-on-rails - 无法通过 Rails 3.2 中的关联模型添加或删除

html - 上面有标签的 Identity 文本框

css - UI5 : how to remove icons from sap. m.IconTabFilter?