为什么 Sass 对分号进行条带化? [英] Why is Sass striping semicolons?
问题描述
我正在使用 Compass 编译 Sass Zen 主题.我收到此警告:
I'm using Compass to compile a Sass Zen theme. I got this warning:
Compass has changed how browser support is configured. The following configuration variables are no longer supported: $legacy-support-for-ie6, $legacy-support-for-ie7, $legacy-support-for-ie8
我安装了旧版本的
compass (0.12.7)
sass (3.2.19)
breakpoint (1.3)
我不再收到警告,但是,我在编译后的代码中丢失了分号.示例:
I'm no longer getting the warning, however, I'm losing semicolons in the compiled code. Example:
/* Address paddings set differently in IE 6/7. */
menu,
ol,
ul {
padding: 0 0 0 $indent-amount; /* LTR */
}
@if $legacy-support-for-ie7 {
/* Correct list images handled incorrectly in IE 7. */
nav ul,
nav ol {
list-style: none;
list-style-image: none;
}
编译为
menu,
ol,
ul {
padding: 0 0 0 30px
/* LTR */
}
注意缺少的分号.似乎到处都有一个 @if $legacy-support-for-ie
指南针然后去掉前面的分号.我的文件中有 51 个 @if $legacy-support-for-ie 声明,如果可能的话,我宁愿保留它们.
Notice the missing semicolon. It seems like everywhere there's an @if $legacy-support-for-ie
compass then strips the preceding semicolon.
There are 51 declarations of @if $legacy-support-for-ie in my files, I'd rather just leave them if possible.
推荐答案
当网站设置为使用 Compass 1.0 之前的版本时,我在使用最新版本的 Compass 时遇到了问题.尝试使用 Compass 0.12.7,然后从那里重建您的依赖项.https://rubygems.org/gems/compass/versions/0.12.7
I've had issues with using the latest version of compass when a site was setup to use the pre 1.0 release of compass. Try using Compass 0.12.7 and then rebuilding your dependencies from there. https://rubygems.org/gems/compass/versions/0.12.7
这篇关于为什么 Sass 对分号进行条带化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!