我遵循了 Michael Hartl 的教程 (http://www.railstutorial.org/),我想更改 custom.scss.css 样式表中的一些 css 函数。每当我对工作表进行任何更改时,例如,将页边距从 10 像素更改为 11 像素,我的浏览器就会出现此错误:
Sass::SyntaxError in StaticPages#home
Showing /Users/Desktop/Sample_App/app/views/layouts/application.html.erb where line #5 raised:
Undefined variable: "$gray-light".
(in /Users/Desktop/Sample_App/app/assets/stylesheets/custom.css.scss:57)
Extracted source (around line #5):
这是一个类似的问题:Bootstrap not working after minor change to custom.css.scss
我不明白为什么会这样。
最佳答案
您正在尝试使用未定义的 sass 变量。定义“$gray-light”或确保它所在的文件是@imported。
关于css - 修改Rails的custom.scss.css导致报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25099273/