SASS全局变量+ Rails 3.1
|
我正在使用带有默认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显然是在查找变量文件,因为它不会引发“找不到文件”错误,如果我更改导入文件名,它也会这样做。 var仍然没有结转。
有任何想法吗?
谢谢!
没有找到相关结果
已邀请:
2 个回复
佩疵瓦
盟犯涩沟都
请注意,文件名中的下划线不是必需的,就像Ruby部分一样。只要将import语句更改为ѭ7,就可以轻松将其命名为
。 site_layout.scss(从site_layout.css.scss重命名)
这将生成一个“ 9”文件,其中包含以下代码替换:
请注意,与使用HAML / ERB文件一样,不需要像ѭ11这样的文件。只需将文件命名为您想要的名称即可。例如,“ 12”将使SASS自动生成一个名为“ 13”的CSS文件。