【问题标题】:Zurb Foundation Sass not Compiling CompletelyZurb Foundation Sass 未完全编译
【发布时间】:2014-10-24 05:06:06
【问题描述】:

编辑: sass 3.4.2 会出现此问题。使用 sass 3.2.13 效果很好。 有什么变化吗?

我使用 bower install foundation 签出了一份新的 Zurb Foundation。

当我尝试使用 compass sass 编译它 (sass foundation.scss > foundation.css) 时,我得到一个缺少某些组件(如按钮)的样式表。

> ruby --version
ruby 1.9.3p545 (2014-02-24) [i386-mingw32]

> scss --version
Sass 3.4.2 (Selective Steve)

采取的具体步骤:

  1. > bower install zurb/bower-foundation

  2. > cd bower_components/foundation/scss

  3. > scss foundation.scss > foundation.css

这是输出:

https://gist.github.com/anonymous/aecbc11a1cefb630a22c

【问题讨论】:

  • 根据文档,您肯定应该使用bower install zurb/bower-foundation?
  • bower install zurb/bower-foundation 的同样问题
  • 我不是 Bower/Sass 用户,但这些 CLI 调用看起来与发布的那些 here 不同。 zurb/bower-foundation 来自他们的 GitHub 存储库。似乎它们可以互换使用?

标签: css sass zurb-foundation compass-sass


【解决方案1】:

Foundation 中似乎存在一个较小的错误(甚至可能与全局变量的使用有关)。

这些警告/错误在较新版本的 Compass 和 SASS 中被抑制(显示的是来自旧版本 Sass/Compass 输出的错误日志)

DEPRECATION WARNING on line 270 of /bower_components/foundation/scss/foundation/components/_global.scss:
Assigning to global variable "$default-float" by default is deprecated.
In future versions of Sass, this will create a new local variable.
If you want to assign to the global variable, use "$default-float: left !global" instead.
Note that this will be incompatible with Sass 3.2.

DEPRECATION WARNING on line 271 of /bower_components/foundation/scss/foundation/components/_global.scss:
Assigning to global variable "$opposite-direction" by default is deprecated.
In future versions of Sass, this will create a new local variable.
If you want to assign to the global variable, use "$opposite-direction: right !global" instead.
Note that this will be incompatible with Sass 3.2.

DEPRECATION WARNING: The return value of index() will change from "false" to
"null" in future versions of Sass. For compatibility, avoid using "== false" on
the return value. For example, instead of "@if index(...) == false", just write
"@if not index(...)".
        on line  of /bower_components/foundation/scss/foundation/_functions.scss, in `exports'
        from line 336 of /bower_components/foundation/scss/foundation/components/_global.scss
        from line 5 of /bower_components/foundation/scss/foundation/components/_grid.scss
        from line 9 of /bower_components/foundation/scss/foundation.scss
        from line 9 of /resources/sass/screen.scss
DEPRECATION WARNING on line 13 of /bower_components/foundation/scss/foundation/_functions.scss:
Assigning to global variable "$modules" by default is deprecated.
In future versions of Sass, this will create a new local variable.
If you want to assign to the global variable, use "$modules: append($modules, $name) !global" instead.
Note that this will be incompatible with Sass 3.2.

我采取的补救措施是为包含 Foundation 的项目创建 gemset,运行旧版本的 Compass 和 Sass 以缓解问题(此过程需要 RVM)

Gemfile(可以使用bundle init生成)

# A sample Gemfile
source "https://rubygems.org"

# gem "rails"
gem "sass",  "3.3.14"
gem "compass",  "1.0.0"

希望这能解决您的问题。

最好的 卢卡斯

【讨论】:

    【解决方案2】:

    我们必须对命令进行一些更改以创建一个新项目和更新 5.4.5 的过程/在 5.4.4 中您不会有任何问题。我们添加了一个 gemfile 以使用 Sass 3.3,以便项目编译并产生弃用警告。

    更多信息在这里: http://foundation.zurb.com/docs/changelog.html

    如果您使用的是 Sass 3.4 和 Compass 1.0,则新命令是: 在运行 Compass watch 之前,每个项目只运行一次 'bundle' ** 然后编译 - 'bundle exec compass watch'

    这样您就不必降级 Sass 版本

    要知道你有什么 Sass 版本 萨斯 -v 指南针-v

    【讨论】:

      猜你喜欢
      • 2012-09-01
      • 2015-07-19
      • 2013-05-01
      • 2020-09-08
      • 1970-01-01
      • 2018-03-11
      • 2016-03-05
      • 2013-03-10
      相关资源
      最近更新 更多