我在默認的SASS設置下使用Rails 3.1RC4。我有以下文件SASS全局變量+ Rails 3.1
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顯然是找到變量文件,因爲它不會拋出「找不到文件」錯誤,如果我更改了導入文件名,它會這樣做。這些變數仍然沒有結轉。
任何想法?
謝謝!
我對存儲在部分中的mixin有完全相同的問題。你有沒有想出一個解決方案? – LandonSchropp
不,我沒有。現在我註釋掉了我的application.css.scss中的require語句,並@手動輸入了我所有其他的sass文件。這工作正常,但希望這只是一個臨時解決方案。 – Denny