css - Zurb Foundation Sass 没有完全编译

标签 css sass zurb-foundation compass-sass

编辑: 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 安装 zurb/bower-foundation

  2. > cd bower_components/foundation/scss

  3. > scss foundation.scss > foundation.css

这是输出:

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

最佳答案

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.

我为补救或解决这个问题所做的是制作一个 gemset对于包含 Foundation 的元素,运行旧版本的 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"

我希望这能解决您的问题。

最佳 卢卡斯

关于css - Zurb Foundation Sass 没有完全编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25580933/

相关文章:

css - Foundation 5 全 Angular 标题图片

javascript - 固定位置元素性能不佳

css - 这个 CSS 的含义

node.js - 使用 NPM 和 Gulp 的 Google Material Design 图标字体

javascript - react 主题样式

javascript - 如何从 parent 的 sibling 中删除类(class)

javascript - 粘性导航在第一次滚动时进行奇怪的跳跃(固定位置)

jquery - 如何显示 "a"到满行

javascript - 相对于图标位置定位 div

drop-down-menu - Zurb Css 框架下拉问题