sass错误编译zurb基础与!全局变量标志 [英] sass error compiling zurb foundation with !global variable flag

查看:236
本文介绍了sass错误编译zurb基础与!全局变量标志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

rake --trace assets:precompile 命令会出现以下错误:

The 'rake --trace assets:precompile' command gives the following error:

rake aborted!
Sass::SyntaxError: Invalid CSS after "...ules: $modules ": expected "}", was "!global;"
  (in app/assets/stylesheets/foundation_and_overrides.scss:13)
foundation-rails-5.5.0.0/vendor/assets/stylesheets/foundation/_functions.scss:13
foundation-rails-5.5.0.0/vendor/assets/stylesheets/foundation/components/_global.scss:5
foundation-rails-5.5.0.0/vendor/assets/stylesheets/foundation/components/_grid.scss:5
foundation-rails-5.5.0.0/vendor/assets/stylesheets/foundation.scss:9
app/assets/stylesheets/foundation_and_overrides.scss:1327

错误似乎来自 foundation-rails-5.5.0.0 / vendor / assets / stylesheets / foundation / _functions.scss '

  8 // IMPORT ONCE
  9 // We use this to prevent styles from being loaded multiple times for compenents that rely o    n other components.
 10 $modules: () !default;
 11 @mixin exports($name) {
 12   // Import from global scope
 13   $modules: $modules !global;
 14   // Check if a module is already on the list
 15   $module_index: index($modules, $name);
 16   @if (($module_index == null) or ($module_index == false)) {
 17     $modules: append($modules, $name) !global;
 18     @content;
 19   }
 20 }

SASS语法对我来说很好,如果我对所生成的'app / assets / stylesheets / foundation_and_overrides.scss。没有进行任何编辑。如果我对该文件进行最小的更改,如下所示,则会出现编译错误。

The SASS syntax looks fine to me, and compiles without error provided I have made no edits to the generated 'app/assets/stylesheets/foundation_and_overrides.scss.' If I make the smallest change to that file, such as the following, the compilation error occurs.

--- a/app/assets/stylesheets/foundation_and_overrides.scss
+++ b/app/assets/stylesheets/foundation_and_overrides.scss
@@ -14,7 +14,7 @@ $base-font-size: 100% !default;
 // Since the typical default browser font-size is 16px, that makes the calculation for grid siz
 // If you want your base font-size to be a different size and not have it effect grid size too,
 // set the value of $em-base to $base-font-size ($em-base: $base-font-size;)
-$em-base: 16px !default;
+$em-base: 17px !default;

 // It strips the unit of measure and returns it
 @function strip-unit($num) {

环境是Rails 4.0.8,foundation-rails 5.5.0.0

Environment is Rails 4.0.8, foundation-rails 5.5.0.0

推荐答案

foundation-rails gem已将其Sass依赖性的下限设置为> = 3.2.0,但使用Sass 3.3功能(!global 标志)。您需要为您的项目指定3.3的依赖项。

The foundation-rails gem has set the lower bounds on their Sass dependency to >= 3.2.0, but are using a Sass 3.3 feature (the !global flag). You'll need to specify a dependency for 3.3 for your project.

我还建议向foundation-rails的维护者提交错误报告。

I also recommend submitting a bug report to the maintainers of foundation-rails.

这篇关于sass错误编译zurb基础与!全局变量标志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆