gulp-sass 缺少一些功能
gulp-sass missing some functionalities
我开始与 gulp 和 sass 进行持续开发。
该工作流程是为暂时无法使用的人员设置的,它一直在为团队中的人员工作。
Sass 在其他人的机器上编译但在我的机器上不编译。
我在我的机器上编译 sass 其他几十个项目都没有问题,但在这个特定的项目上没有问题。
我想我确实正确地初始化了项目,但我怀疑涉及到一些版本或配置问题。
如果我 npm install
一切和 运行 gulp
我得到以下错误:
Error: src/sass/utilities/mixins/_vendor-prefixes.scss
Error: Invalid CSS after "::-webkit-": expected "{", was "&-placeholder"
"&-placeholder" may only be used at the beginning of a compound selector.
on line 116 of src/sass/utilities/mixins/_vendor-prefixes.scss
我尝试评论有问题的行并再次 运行ning gulp
只是偶然发现另一个错误:
Error: src/sass/base/_base.scss
Error: "ul" failed to @extend "%reset-list".
The selector "%reset-list" was not found.
Use "@extend %reset-list !optional" if the extend should be able to fail.
on line 142 of src/sass/base/_base.scss
以此类推:
Error: src/sass/utilities/_placeholders.scss
Error: You may not @extend an outer selector from within @media.
You may only @extend selectors within the same directive.
From "@extend %clearfix" on line 38 of src/sass/modules/_calendar.scss
on line 9 of src/sass/utilities/_placeholders.scss
此代码适用于其他机器,所有高级选择器都在开发中使用。
如果我 google 对于特定的错误,我可以找到关于它们的错误以及建议替代选择器的人,但我怀疑还有其他事情需要我解决。
我已将 gulp
更新为 3.9.1
,将 gulp-sass
更新为 3.1.0
,但我得到了同样的错误。
我应该如何调试它?
谢谢!
EDIT: The errors are clearly stating that the code is not valid but the strange thing is that the same code is working on other peoples machines.
我会post一些代码来解决一些错误,仅供参考:
_vendor-prefixes.scss:116
// Placeholder focus text
@mixin placeholder-focus($color: $input-color-placeholder) {
&:focus::-webkit-&-placeholder { color:$color; }
&:focus:-moz-placeholder { color:$color; } /* FF 4-18 */
&:focus::-moz-placeholder { color:$color; } /* FF 19+ */
&:focus:-ms-input-placeholder { color:$color; }
}
_base.scss:142
// Unordered and Ordered lists
ul,
ol {
@extend %reset-list;
}
和 _placeholders.scss
上的包含
// Reset List
%reset-list {
padding:0;
margin:0;
li {
list-style:none;
}
}
这与功能或版本无关。
正如@rac指出的代码是无效的。
其他开发人员以某种方式跳过了错误,编译后的 .css 没有错误的行或错误的扩展。
删除所有错误行导致相同的 .css 和干净的编译。
谢谢!
我开始与 gulp 和 sass 进行持续开发。
该工作流程是为暂时无法使用的人员设置的,它一直在为团队中的人员工作。
Sass 在其他人的机器上编译但在我的机器上不编译。
我在我的机器上编译 sass 其他几十个项目都没有问题,但在这个特定的项目上没有问题。
我想我确实正确地初始化了项目,但我怀疑涉及到一些版本或配置问题。
如果我 npm install
一切和 运行 gulp
我得到以下错误:
Error: src/sass/utilities/mixins/_vendor-prefixes.scss
Error: Invalid CSS after "::-webkit-": expected "{", was "&-placeholder"
"&-placeholder" may only be used at the beginning of a compound selector.
on line 116 of src/sass/utilities/mixins/_vendor-prefixes.scss
我尝试评论有问题的行并再次 运行ning gulp
只是偶然发现另一个错误:
Error: src/sass/base/_base.scss
Error: "ul" failed to @extend "%reset-list".
The selector "%reset-list" was not found.
Use "@extend %reset-list !optional" if the extend should be able to fail.
on line 142 of src/sass/base/_base.scss
以此类推:
Error: src/sass/utilities/_placeholders.scss
Error: You may not @extend an outer selector from within @media.
You may only @extend selectors within the same directive.
From "@extend %clearfix" on line 38 of src/sass/modules/_calendar.scss
on line 9 of src/sass/utilities/_placeholders.scss
此代码适用于其他机器,所有高级选择器都在开发中使用。
如果我 google 对于特定的错误,我可以找到关于它们的错误以及建议替代选择器的人,但我怀疑还有其他事情需要我解决。
我已将 gulp
更新为 3.9.1
,将 gulp-sass
更新为 3.1.0
,但我得到了同样的错误。
我应该如何调试它?
谢谢!
EDIT: The errors are clearly stating that the code is not valid but the strange thing is that the same code is working on other peoples machines.
我会post一些代码来解决一些错误,仅供参考:
_vendor-prefixes.scss:116
// Placeholder focus text
@mixin placeholder-focus($color: $input-color-placeholder) {
&:focus::-webkit-&-placeholder { color:$color; }
&:focus:-moz-placeholder { color:$color; } /* FF 4-18 */
&:focus::-moz-placeholder { color:$color; } /* FF 19+ */
&:focus:-ms-input-placeholder { color:$color; }
}
_base.scss:142
// Unordered and Ordered lists
ul,
ol {
@extend %reset-list;
}
和 _placeholders.scss
上的包含// Reset List
%reset-list {
padding:0;
margin:0;
li {
list-style:none;
}
}
这与功能或版本无关。
正如@rac指出的代码是无效的。
其他开发人员以某种方式跳过了错误,编译后的 .css 没有错误的行或错误的扩展。
删除所有错误行导致相同的 .css 和干净的编译。
谢谢!