【发布时间】:2016-04-12 15:08:42
【问题描述】:
谈到 SCSS,我绝对是个新手。我需要一些帮助。
我在我的 Rails 4.2.4 项目中使用了 Zurb Foundation gem。我正在尝试进行一些全局自定义,例如更改 body-bg 颜色。我进入了 assets/stylesheets 文件夹中的foundation_and_overrides.scss 并取消了注释
$body-bg: $white;
希望将其更改为 $steel 或类似的。当我重新加载页面时,我得到 p>
app/views/layouts/application.html.erb where line #7 raised:
Undefined variable: "$white".
application.html.erb 开始:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><%= content_for?(:title) ? yield(:title) : "foodian" %></title>
<meta name="description" content="<%= content_for?(:description) ? yield(:description) : "Foodian" %>">
<%= stylesheet_link_tag "application" %>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%# Modernizr is required for Zurb Foundation %>
<%= javascript_include_tag 'vendor/modernizr' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
我确信我忽略了一些简单的事情。但我找不到任何“傻瓜”的例子。请帮忙。
application.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 bottom of the
* compiled file so the styles you add here take precedence over styles defined in any styles
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope.
*
*= require_tree .
*= require_self
*/
/*= require foundation */
@import "foundation_and_overrides";
【问题讨论】:
标签: ruby-on-rails sass zurb-foundation