1

我正在尝试让 scss 渐变从colorzilla 的方便渐变编辑器中工作。将该 scss 代码添加到 assets/stylesheets/header.css.scss 时出现错误:

未定义的混合“过滤梯度”。(在 /Users/me/code/app/assets/stylesheets/header.css.scss 中)

所以我将其添加@import "compass/css3/images";到我的 header.css.scss 文件中:

@import "compass/css3/images";

header address {
  background-color: #c9de96;
  @include filter-gradient(#c9de96, #398235, vertical);
  $experimental-support-for-svg: true;
  @include background-image(linear-gradient(top,  #c9de96 0%,#8ab66b 44%,#398235 100%));
}

现在我得到这个错误:

找不到或无法读取要导入的文件:compass/css3/images。加载路径:Sass::Rails::Importer(/Users/me/code/app/assets/stylesheets/header.css.scss) (在/Users/me/code/app/assets/stylesheets/header.css.scss )

我必须将 compass-rails 添加到我的 Gemfile 中:

group :assets do
  gem 'sass-rails'
  gem 'coffee-rails'
  gem 'compass-rails'
  gem 'uglifier'
end

如何让这些线性渐变与 scss 和 rails 一起使用?

4

2 回答 2

2

很生气在这上面浪费时间。我只需要重新启动网络服务器!

于 2012-10-04T15:49:18.077 回答
0

I am posting this answer just in case someone runs into a similar problem like I did using compass 0.12.2. In your .scss file include this:

@import "compass";
于 2013-10-04T11:04:41.247 回答