编辑: sass 3.4.2会出现此问题。使用sass 3.2.13非常有效。 有什么改变吗?
我使用bower install foundation
检查了Zurb Foundation的新副本。
当我尝试使用罗盘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)
采取了确切的步骤:
> bower install zurb/bower-foundation
> cd bower_components/foundation/scss
> scss foundation.scss > foundation.css
这是输出:
答案 0 :(得分:2)
基金会内似乎存在一个较小的错误(甚至可能与全局变量的使用有关)。
这些警告/错误在较新版本的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"
我希望这能解决您的问题。
最佳卢卡斯
答案 1 :(得分:0)
我们必须对Command进行一些更改,以创建一个新项目和更新5.4.5 / In 5.4.4的过程,您将不会遇到任何问题。我们添加了一个gem文件来使用Sass 3.3,以便项目编译并生成弃用警告。
更多信息: http://foundation.zurb.com/docs/changelog.html
如果您使用Sass 3.4和Compass 1.0,则新命令为: 在运行Compass手表之前,请运行'捆绑' **每个项目只有一次 然后编译 - '捆绑执行罗盘手表'
这样你就不必降级Sass版本
知道你有什么Sass版本 Sass -v 罗盘-v