我正在使用带有默认 SASS 设置的 Rails 3.1RC4。我有以下文件
application.css.scss
/*
* This is a manifest file that'll automatically include all the stylesheets available in this directory
* and any sub-directories. 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 .
*/
_variables.css.scss
$var1 : somevalue;
...
site_layout.css.scss
@import "variables";
... Some Sass Code
但是我无法访问site_layout 中_variables.css.scss 中定义的变量。我究竟做错了什么? Rails 显然正在查找变量文件,因为它不会抛出“未找到文件”错误,如果我更改导入文件名,就会出现这种错误。仍然没有结转 vars。
有任何想法吗?
谢谢!
最佳答案
最新版本的 rails & sprockets 似乎解决了这个问题。在您的 gemfile 中:
gem 'rails', :git => "git://github.com/rails/rails.git", :branch => "3-1-stable"
关于ruby-on-rails - SASS 全局变量 + Rails 3.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6393195/